man2600 Posted November 5 Share Posted November 5 hi guys!, i have been making a game in batari basic from scratch, and i was testing it but for some reason, it cant move beyond his starting point or does it return to it, im not sure but does anyone have any idea what it is and how i can fix it ? im going to leave the code here: default.bas Quote Link to comment https://forums.atariage.com/topic/374899-why-cant-the-player-move-beyond-his-starting-point/ Share on other sites More sharing options...
Lost Monkey Posted November 5 Share Posted November 5 From a cursory glance, you are loading a value for the player's x and y positions in the main loop. This will keep putting the object in the same spot. player0x=27 player0y=48 3 Quote Link to comment https://forums.atariage.com/topic/374899-why-cant-the-player-move-beyond-his-starting-point/#findComment-5560683 Share on other sites More sharing options...
LatchKeyKid Posted November 5 Share Posted November 5 Yeah, you have to be careful where you declare the initial starting values for sprite locations as you could have some code to control the movement later and then in the kernel yoyo them back to the original starting spot before the drawscreen. I've learned that lesson myself... repeatedly... over and over. Quote Link to comment https://forums.atariage.com/topic/374899-why-cant-the-player-move-beyond-his-starting-point/#findComment-5560797 Share on other sites More sharing options...
man2600 Posted November 5 Author Share Posted November 5 (edited) so that means i have to set the player0y=48:player0x=27 out of the go to main Edited November 5 by man2600 Quote Link to comment https://forums.atariage.com/topic/374899-why-cant-the-player-move-beyond-his-starting-point/#findComment-5561121 Share on other sites More sharing options...
LatchKeyKid Posted November 6 Share Posted November 6 2 hours ago, man2600 said: so that means i have to set the player0y=48:player0x=27 out of the go to main If you want it just for initial placement, do it before the main declaration. Quote Link to comment https://forums.atariage.com/topic/374899-why-cant-the-player-move-beyond-his-starting-point/#findComment-5561185 Share on other sites More sharing options...
Impaler_26 Posted November 6 Share Posted November 6 9 hours ago, man2600 said: so that means i have to set the player0y=48:player0x=27 out of the go to main Yes, you can set the player's initial position in the "start" loop. Also you don't need to go to the "sprites" label as they are defined in the "main" loop. And bB sets the tv-type to NTSC by default so you also don't need that line. Just have a look at this re-arrangaded version of your code, it works as intended: default2.bas default2.bas.bin 1 Quote Link to comment https://forums.atariage.com/topic/374899-why-cant-the-player-move-beyond-his-starting-point/#findComment-5561268 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.