Lillapojkenpåön Posted January 21, 2016 Share Posted January 21, 2016 if !collision(player0,player1) then goto __Skip_p0_Collisiontemp5 = _Data_Sprite_Width[_Sprite_Size0]if (player0y + 10) >= player1y && player0y <= (player1y + 10) && (player0x + temp5) >= player1x && player0x <= (player1x + 7) then pfpixel 9 11 onif (player0y + 10) >= player2y && player0y <= (player2y + 10) && (player0x + temp5) >= player2x && player0x <= (player2x + 7) then pfpixel 9 20 on__Skip_p0_Collision Can the data sprite width and sprite size tables be replaced with just some variables/numbers if i don't want to use 3 different nusiz like in rt's example? temp5 = something simple? Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted January 21, 2016 Author Share Posted January 21, 2016 I figured it out myself, this works very well if !collision(player0,player1) then goto __Skip_p0_Collision temp5 = player1x if (player0y + 10) >= player1y && player0y <= (player1y + 10) && (player0x + temp5) >= player1x && player0x <= (player1x + 7) then goto player1dead if (player0y + 10) >= player2y && player0y <= (player2y + 10) && (player0x + temp5) >= player2x && player0x <= (player2x + 7) then goto player2dead__Skip_p0_Collision if (missile0y + 10) >= player1y && missile0y <= (player1y + 10) && (missile0x + temp5) >= player1x && missile0x <= (player1x + 7) then goto player1dead if (missile0y + 10) >= player2y && missile0y <= (player2y + 10) && (missile0x + temp5) >= player2x && missile0x <= (player2x + 7) then goto player2dead I also removed temp5 = player1x completely and it still works perfect, definitely looked like you had to define temp5 there in that example Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 21, 2016 Share Posted January 21, 2016 What example are you talking about? Most people can't read minds. Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted January 21, 2016 Author Share Posted January 21, 2016 Your collision detection (dpc+) example Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 21, 2016 Share Posted January 21, 2016 Your collision detection (dpc+) example Thanks. That program is basically just a toy for doing little experiments (playing with sprite sizes, seeing how playfield collision works, and so on). It wasn't designed to be used as a template. I need to make some simpler DPC+ example programs one of these days. Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted January 24, 2016 Author Share Posted January 24, 2016 If you make a simpler collision example sometime, I would suggest including a death animation, you know the classic one where you shoot a sprite and it turns into particles. I couldn't find a single bB game that had that. I made a working routine but i had to put duplicates of all the other sprites animation (walking) frames inside it, and they usually pick up at the wrong animation frame when one of them dies. Btw if s=10 then player1-9: %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000 %00000000end If I don't want player3 in there, how would that look if possible? 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.