funkheld Posted March 24, 2017 Share Posted March 24, 2017 Hi good afternoon. How can you build a collisons counter here? Thank you. greeting x=50 y=50 COLUBK=200 main if collision(player1,player0) then COLUBK=$28 else COLUBK=200 COLUPF=214 COLUP0=128 COLUP1=64 player0: %00011100 %00011000 %00011000 %00100000 %01011010 %01111100 %00100100 %00010000 %00011000 %00111100 %00011000 end player1: %00011100 %00011000 %00011000 %00100000 %01011010 %01111100 %00100100 %00010000 %00011000 %00111100 %00111100 end player0x=x player0y=y player1x=80 player1y=30 drawscreen if joy0right then x=x+1 if joy0left then x=x-1 if joy0up then y=y-1 if joy0down then y=y+1 goto main Quote Link to comment Share on other sites More sharing options...
arkleyjoe Posted April 4, 2017 Share Posted April 4, 2017 This should be quite simple. You can add another variable where you currently have have y=50 add a new variable. For example: i=0 : rem Used to count collisions. where you test for collision in this line. if collision(player1,player0) then COLUBK=$28 else COLUBK=200 You should adjust that line to increment your counter. if collision(player1,player0) then i=i+1 That would be a simple way to do it. I hope that points you in the right direction. Joe 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.