Jump to content



Photo
- - - - -

Text Messes Up Variables X And Y


  • Please log in to reply
1 reply to this topic

#1 Somelauw

Somelauw

    Newbie

  • Members
  • Pip
  • 14 posts

  • Calculators:
    Casio CFX-9850GC PLUS

Posted 23 March 2008 - 09:03 PM

I have a casio CFX 9850GC PLUS. I'm pretty handy with it and I'm making a Snake game.
I don't know if this forum is meant for serious use only, but the calculator has a getkey function which only comes in handy when programming games.


My problem is:
I have programmed a snake game and everything works except drawing the snake itself.
My problem is that I'm using variables x and y as coordinats for the head of the snake.
However when I want to draw his head using:
text y, x, "O"
my x and y variables are changed to floats which makes an error occur the next step.

A solution would be to replace x and y by other values. Which ones are best suited?
Also what happens with my x and y variables?
A bigger x seems to lead to a bigger x.
A bigger y seems to lead to a lower y.
I think these are graphic coordinats. How to get these right?

My graphic viewwindow setting is (1, 127, 1, 1, 63, 1) by the way.

#2 kucalc

kucalc

    Casio Maniac

  • [Legends]
  • PipPipPipPipPipPipPipPip
  • 1422 posts
  • Gender:Male
  • Location:USA
  • Interests:Programming: C/C++, Fortran, LISP, COBOL 85 Standard, PHP, x86 and SH3 Assembly

    Computer graphics

  • Calculators:
    fx-9860G / fx-7400G Plus / Algebra FX 2.0+ / fx-9770G / CFX-9850G / CFX-9850GB+ / TI-89 / TI-nSpire

Posted 24 March 2008 - 12:14 AM

Hello Somelauw and welcome to the UCF!

I don't know if this forum is meant for serious use only, but the calculator has a getkey function which only comes in handy when programming games.[/i]

Hehehe, don't worry. Just make yourself comfortable. :)

Concerning about your problem, you should use variables other the x and y. You can use A - Z and theta as your variable. Also if you want to convert a floating number to an integer, use the Int command.

I'll be moving this topic to the Programming/Development Section soon, so I'm just letting you know....


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users