Need to change something?

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
Chris
2nd Star Corporal
Posts: 29
Joined: Tue Jun 05, 2007 1:45 am
Location: Oregon, United States
Contact:

Need to change something?

Post 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.
User avatar
Pengwin
Pilot Officer
Posts: 69
Joined: Sun Jan 07, 2007 11:03 pm
Location: Scotland
Contact:

Post 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?
User avatar
Pengwin
Pilot Officer
Posts: 69
Joined: Sun Jan 07, 2007 11:03 pm
Location: Scotland
Contact:

Post 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.
Chris
2nd Star Corporal
Posts: 29
Joined: Tue Jun 05, 2007 1:45 am
Location: Oregon, United States
Contact:

Post 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.
User avatar
Pengwin
Pilot Officer
Posts: 69
Joined: Sun Jan 07, 2007 11:03 pm
Location: Scotland
Contact:

Post 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.
Post Reply