SloeGin Posted February 14, 2008 Share Posted February 14, 2008 (edited) I'm trying to code some groundwork for a game idea. So far I have the following done: 1) Move player0 and player1 around the playfield and fire a missile 2) Player must wait for missile to reach end of playfield before firing again 3) Missiles fire in direction player is facing 4) The sprite for a player changes relative to the direction the player is moving 5) Scroll the playfield when a player tries to move beyond playfield boundaries 6) When a player causes the playfield to scroll, adjust the other player's x/y relative to the playfield 7) If both players are at full opposite ends of the playfield, do not scroll There's no collision detection or sound and the sprites are purely functional. How can I simplify my code? Specifically, I'd like to be able to remove the tons of redundancies. Right now I'm doing almost everything twice: once for player0/joy0/missile0, then do the same thing for player1/joy1/missile1. How can I make these into individual subroutines that know which player's attributes to modify? I feel like I'm way over thinking the "Playfield Magic" section. Any thoughts/advice on a better way to accomplish this? (edit: changed topic title) (updated code: added x/y correction for missiles, still not perfect though) pvpbasecode.bas pvpbasecode.bin Edited February 14, 2008 by SloeGin 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.