Jump to content



Photo
- - - - -

PixlTest


  • Please log in to reply
12 replies to this topic

#1 casiokingdom

casiokingdom

    UCF BASIC Programming 2nd Place

  • Members
  • PipPipPipPipPipPipPip
  • 782 posts
  • Gender:Male
  • Location:Perth, WA, Australia

  • Calculators:
    CFX-9850GB PLUS WE, fx-9860G AU

Posted 23 August 2003 - 05:15 AM

You know how some snake games (eg. Xworm) are graph based and use the PxlTest command.

i'm not completely sure how to use it.

i want to draw random dots around the screen and then when my snake hits any dot, it goes gameover.

can somebody please help. :(

#2 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 23 August 2003 - 05:25 AM

Wll it is not very fast to use graphics mode but i'll explain it though:

PxlTest:

PxlTest X,Y

;This tests the pixel at X ,Y (Not sure maybe upside down: Y,X)

Now you can't use the result directly so you have to do it the folowing way:

PixelTest A,B ;A/B is the head of the snake
Ans=1=>Goto s ;Pixel is set! Die!!!


It's silly you can't use it in conditions but Ans contains the value pixeltest returns. Good Luck!

#3 genesis

genesis

    UCF BASIC Programming Runner Up

  • Super Member
  • PipPipPipPip
  • 281 posts
  • Location:Perth, Australia
  • Interests:Speaking German, computers, defending CFX calculators...

  • Calculators:
    CFX 9850 GB+

Posted 23 August 2003 - 07:16 AM

Good explanation. It's sort of the Casio version of 'hitcollisiontest' :D (for those people who know programming or flash). Also, PxlChg inverts the pixels but doesn't invert colour.

Who here makes color games, I can't be bothered, it's not like we need the colour, black and white games are already slow.

#4 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 12:11 PM

its not the color commands that make a game slow, its the mere fact that calc can do color.

#5 Endi

Endi

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts
  • Location:Wroclaw, Poland

  • Calculators:
    AFX 2.0 PLUS

Posted 23 August 2003 - 07:43 PM

maybe it's better to do this snake game in text mode...
I'm not sure if Locate function works slower than SetPxl. Possibly yes, but in text mode the snake is clearer and easier to lead to target.
Anyway I made snake in text, but it worked rather slow after eating 12 targets. It is not a problem to enlarge snake, but to check impacts.

#6 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 07:51 PM

if you do a snake game in text mode you have to use a matrix, and it will be slower. if you want a good example of a snake game in graph mode look at the Nibbles 123 game on my site, its my first, second, and third attempt at a snake game (its three games).

#7 Endi

Endi

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts
  • Location:Wroclaw, Poland

  • Calculators:
    AFX 2.0 PLUS

Posted 23 August 2003 - 08:09 PM

I didn't use matrix. I used two lists and a variable to point to an actual 'head' cell. I used scrolling through these lists.

#8 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 08:11 PM

I meant for collisons with the obsicles on the screen, not the snake. anyway, its much better to do it in graph mode, i strongly urge you to take a look at the Nibbles 123 on my site, you will see what i mean.

#9 Endi

Endi

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts
  • Location:Wroclaw, Poland

  • Calculators:
    AFX 2.0 PLUS

Posted 23 August 2003 - 08:16 PM

I have some problems with my normal COM port (and my mouse port never worked with Casio cable). I have to test it with an emulator, but maybe not today. Anyway I've just downloaded it.

#10 CrimsonCasio

CrimsonCasio

    UCF Ambassador

  • [Legends]
  • PipPipPipPipPipPipPipPipPipPip
  • 3579 posts
  • Gender:Male
  • Location:USA
  • Interests:Claculators, Stephen King, Video Games, Calculators, Programming, Calculators, Reading, Calculators... hmm, what else... Ah! Calculators!

  • Calculators:
    Algebra FX2.0, CFX 9850Ga+, Classpad 300

Posted 23 August 2003 - 08:17 PM

ok, you can at least look at the code.

#11 ross8653

ross8653

    Casio Addict

  • Members
  • PipPipPip
  • 96 posts
  • Location:over the river and through the woods
  • Interests:paintball

  • Calculators:
    9850 fx2.0

Posted 24 August 2003 - 04:12 AM

have you thought of using text?
writing the deg sign (which actually turns out to be a 3x3 hollow square) and turning the middle pixel on, is faster than drawing 3 flines to fill the same space (on the AFX2.0)

also for clearing you could write a text space (" ") somewhere to the end. This would end up being a lot faster than clearing 9 pxls

if you look at my tetris game's loading screen i use this method but it turned out to be way too much of a problem for ingame graphics

#12 huhn_m

huhn_m

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1957 posts
  • Gender:Male
  • Location:Germany / Dresden
  • Interests:Assembler(!!!)
    Computers and Programming
    Operating Systems
    Programmable Calculators
    Maths and everything arround it

  • Calculators:
    FX-82SX / AFX 2.0+ (ROM 1.03) / FX 1.0+ (ROM 1.03)

Posted 24 August 2003 - 10:13 AM

I made a snake game in graph mode that ran pretty fast!
It also includes a level editor to make own levels.

It's quite easy!

Here is the link:

Snake GAME

In level editor:

EXE = SET WALL
- = RESET WALL
EXP = SAVE MAP

*EDIT

If you get an error click right on the link and choose "save target as"

or click in the adresse field and press enter to reload the file. It will work then.

#13 casiokingdom

casiokingdom

    UCF BASIC Programming 2nd Place

  • Members
  • PipPipPipPipPipPipPip
  • 782 posts
  • Gender:Male
  • Location:Perth, WA, Australia

  • Calculators:
    CFX-9850GB PLUS WE, fx-9860G AU

Posted 25 August 2003 - 06:36 AM

thanks for all the help guys B)




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users