jamesorgames_312 Posted August 17, 2015 Share Posted August 17, 2015 I need help making my Playfield walls solid so my two sprites (player0 and player1) can not go through them, just like in Pac-Man and Maze Craze. That would be awesome. I will leave my current code so anybody can help. Thank you so much! P.S I'm new to batari basic. default.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 17, 2015 Share Posted August 17, 2015 Check out some of the example programs on the bB page: randomterrain.com/atari-2600-memories-batari-basic-commands.html#sprite_collision_example randomterrain.com/atari-2600-memories-batari-basic-commands.html#maze_32x12 This might also be semi-helpful: atariage.com/forums/topic/239220-collision-prevention-with-adjustable-sprite-height-and-width/ Quote Link to comment Share on other sites More sharing options...
jamesorgames_312 Posted August 17, 2015 Author Share Posted August 17, 2015 (edited) I did and the code made only my player0 not move through walls, but my player1 was a different color and did not move towards me like he was supposed to! Edited August 17, 2015 by jamesorgames_312 Quote Link to comment Share on other sites More sharing options...
Papa Posted August 17, 2015 Share Posted August 17, 2015 I always do something like... if player0x<15 then player0x=15 (possible limit for left side) if player1x<15 then player1x=15 if player0x>125 then player0x=125 (possible limit for right side) if player1x>125 then player1x=125 This would form two barriers on the left and right side of the screen that neither players can go through. Quote Link to comment Share on other sites More sharing options...
bogax Posted August 18, 2015 Share Posted August 18, 2015 figure out where you want to move to then check it for a playfield pixel there. if there is, don't move (or bounce or something) if there isn't then move. platfield pixels are 8 pixels wide (in the standard kernel) and are offset from the player's position (playfield pixel 0 covers player positions 10..17 (or something, forget the offset)) the playfield pixels are in var0..var43 bit 7 of var0 is playfield pixel 0 (top left) var0..var3 are the first (top) line of the playfield, var4..var7 the second line, etc some of the bytes are reversed (instead of bit 7..0 going left to right some are 0..7 going left to right) Quote Link to comment 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.