Jump to content

JC Software

New Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by JC Software

  1. Ok so here's the example: rem 9 for top, 88 for bottom player0: %10011001 %01000010 %00100100 %10011001 %10011001 %00100100 %01000010 %10011001 end player0x = 50 : player0y = 50 __game COLUP0=$82 if joy0up then player0y = player0y-5 if joy0down then player0y = player0y+5 if player0y < 10 then player0y = 10 if player0y > 85 then player0y = 85 drawscreen goto __game rem code is over We have a big problem though, the player goes way to fast and doesn't look gird based at all... So we need a variable Right before any other code type this... dim _movement = a This will be our movement variable taking up variable "a" Now let's put it to use... We want to be able to move at the beginning so add this before __game -> _movement = 1 Also add this after COLUP0 --> if _movement = 0 then goto __game Now add a colon after the player movement commands like this... if joy0up then player0y = player0y-5 : _movement = 0 if joy0down then player0y = player0y+5 : _movement = 0 Now when you push on the joystick _movement will become 0, this will skip the movement commands and make the player not be able to move. Of course we want the player to move multiple times, so we need to add one final code strip... Add this after COLUP0 if !joy0up && !joy0down then _movement = 1 Now everytime the joystick goes up or down, you only move 5 once... However the sprite seems to disappear whenever you hold up or down, I would fix that now but I have to eat dinner, so I'll be back Here's the full example... rem 9 for top, 88 for bottom dim _movement = a player0: %10011001 %01000010 %00100100 %10011001 %10011001 %00100100 %01000010 %10011001 end player0x = 50 : player0y = 50 _movement = 1 __game COLUP0=$82 if !joy0up && !joy0down then _movement = 1 if _movement = 0 then goto __game if joy0up then player0y = player0y-5 : _movement = 0 if joy0down then player0y = player0y+5 : _movement = 0 if player0y < 10 then player0y = 10 if player0y > 85 then player0y = 85 drawscreen goto __game
  2. I can tell you completely new, so I'll help you out as basic as possible, but make sure to teach yourself if your really serious about this. First we make the player move by pressing up or down on the joystick if joy0down then player0y=player0y+5 if joy0up then player0y=player0y-5 but wait... we don't him off screen now do we Looking at random terrain's (move sprite) example we known the boundaries of the screen for vertical movement would be 9-88. Since were moving by 5, try this if player0y<10 then player0y=10 if player0y>85 then player0y=85 Now we can't go off screen and were moving like a grid in a way... but when we hold the joystick we move across these points too fast! (I'll be back for part 2)
  3. Oh man thank you so much! (Also love the Eric Carle caterpillar, that's my favorite children's book)
  4. Also, does anyone know how 'Robsome' got a help tag in his title?
  5. This is my first post on any atariage forum, if this is the wrong place to post this topic, then I'll gladly move it. First of all, I just need to give out a big thank you to Random Terrain for the awesome tutorial page (I use it like a bB bible), atariage for this forum, and anyone who worked on batari basic/visual bB. So while testing out my first project this weird glitch came out of nowhere, everything works fine until the player touches (collides) with player1 (the finish flag). When this happens the game starts all over. I assume either a variable was messed up or misspelled, or perhaps players can't collide? (I don't need anything else fixed, I know the movement of the player sucks as well as the collision against walls. I'll be sure to improve those in Max's Maze 2) Max's_Maze_2017_11_2_1723.bas
×
×
  • Create New...