Page 1 of 1

Need to change something?

Posted: Thu Jun 07, 2007 8:08 am
by Chris
Let's say I've got a code like this:
Image

This works well, as every time the sub (or should I say the equals sign) goes one point, it erases the one behind it. Unfortunately, ever since I press a key to make it go a direction, I can't change the direction. What would I need to change in order for the game to let me change the direction I'm going? (and what do I need to put in order to use the arrow keys instead of W, A, S, and Z (w=up, a=left, s=right, and z=down). If you need more code, then tell me and I'll post the whole thing.

Posted: Thu Jun 07, 2007 8:44 am
by Pengwin
Line 260 reads:

Code: Select all

260 GOTO 202
it should read:

Code: Select all

260 GOTO 200
Also, why the GET H$ on line 220?

Posted: Thu Jun 07, 2007 8:46 am
by Pengwin
Just another thought, the line

Code: Select all

200 GET H$
will pause the program at that line. If the game is to run realtime (sorry, I've not seen the Atari version yet), then I would replace it with

Code: Select all

200 H$=KEY$
This would then make the submarine continue in the direction specified until another key is pressed.

Posted: Thu Jun 07, 2007 9:52 am
by Chris
I want the sub to move like Pac-Man and Nibbles do. The sub should keep going until it either A=reaches a wall until it dies, or B=changes direction when a player presses a button. If I change line 260 to read "GOTO 200", then the player will move one space and then stop. That's why I changed it to read "GOTO 202" By the way, I've decided not to add walls and just make this a Nibbles-type game for now (without the growth, of course.) He can still crash into the edges and die, though.

Posted: Thu Jun 07, 2007 9:54 am
by Pengwin
if you change the GET H$ to H$=KEY$ and line 260 to GOTO 200, then you should get the effect you're after.