Captain Spazer Posted January 24, 2019 Share Posted January 24, 2019 Im experimenting with a platformer with a 4 way scrolling level, i got collision detection working well left and right, and I can do collision for hitting a roof, but not floors, whatever I do, when touching the floor the player zips along the ground. Is there a simple solution I'm not seeing? the idea is you got a helicopter on your back, holding down the firebutton makes you fly, releasing it makes you fall down rem Generated 24-01-2019 14:19:54 by Visual bB Version 1.0.0.568 rem ********************************** rem *<filename> * rem *<description> * rem *<author> * rem *<contact info> * rem *<license> * rem ********************************** player0y = 79 player0x = 50 playfield: ................................ ................................ X...XXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ .....................X.......... ....................XX.......... XXXXXXXXXXXXXXXXXX..XXXXXXXXXXXX end main COLUPF = $0E COLUP0 = $0E player0: %00001100 %00001000 %00001000 %00111100 %00111000 %00100110 %00100110 %01110000 end drawscreen if b = 0 && collision(player0,playfield) then pfscroll left if b = 1 && collision(player0,playfield) then pfscroll right if joy0left then pfscroll right : b = 0 if joy0right then pfscroll left : b = 1 if joy0fire then pfscroll down if !joy0fire then pfscroll up if collision(player0,playfield) then pfscroll down goto main Quote Link to comment Share on other sites More sharing options...
+Lewis2907 Posted January 24, 2019 Share Posted January 24, 2019 CPT Spazer, This may help. http://atariage.com/forums/topic/218190-smooth-vertical-scrolling-from-data-want-4-way/ Quote Link to comment Share on other sites More sharing options...
+Lewis2907 Posted January 24, 2019 Share Posted January 24, 2019 I forgot to say I'm interested in what you come up with also, thanks. Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 25, 2019 Author Share Posted January 25, 2019 (edited) Thank you, very interesting. I managed to get it working better, you no longer slide all over the place. Your demo is very helpful. edits made: rem Generated 25-01-2019 13:47:00 by Visual bB Version 1.0.0.568 rem ********************************** rem *<filename> * rem *<description> * rem *<author> * rem *<contact info> * rem *<license> * rem ********************************** player0x = 50 : player0y = 50 playfield: ................................ ................................ ..........XXX................... ...........X.................... ................................ ......................XXXXXXX... .......................XX.XX.... ......XXXXXXX...........X....... .......X.XXX.................... ..........X..................... ................................ end main COLUP0 = $0E COLUPF = $0E if d = 10 then player0: %00011000 %00010000 %00010000 %01111000 %01110000 %00011000 %00100000 %00011000 end if d = 20 then player0: %01001100 %01111000 %00010000 %01111000 %01110000 %00011000 %00100000 %00011000 end if c = 10 then player0: %00011000 %00010000 %00010000 %01111000 %01110000 %00011000 %00100000 %00011000 end if c = 20 then player0: %00011000 %01010000 %00010000 %01111000 %01110000 %00011000 %00100000 %00011000 end drawscreen rem if a = 0 then fall rem if a = 1 then fly rem if a = 2 then land on floor rem if a = 3 player hits the roof if a = then pfscroll up if !joy0up then a = 0 if a = 0 && collision(player0,playfield) then a = 2 if a = 2 then pfscroll down : b = 0 : d = 0 rem fly animation if a = 1 then c = c + 1 if a = 0 then c = c + 1 if c > 20 then c = 0 rem walk animation if a = 1 then pfscroll down if joy0up then a = 1 if a = 1 && collision(player0,playfield) then a = 3 if a = 3 then pfscroll down if b = 1 && collision(player0,playfield) then pfscroll left if b = 2 && collision(player0,playfield) then pfscroll right if joy0left && a = 0 then pfscroll right : b = 1 : e = 1 if joy0right && a = 0 then pfscroll left : b = 2 : e = 0 if joy0left && a = 1 then pfscroll right : b = 1 : e = 1 if joy0right && a = 1 then pfscroll left : b = 2 : e = 0 rem flip player sprite if e = 1 then REFP0 = 8 if e = 0 then REFP0 = 0 goto main Edited January 25, 2019 by Captain Spazer 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.