? How do you make a sprite collide with a bigger sprite? (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

How do you make a sprite collide with a bigger sprite?

  • #1 ✎ 6 Finnow Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies Ok, so basically I’m trying to make a 2d platformer, and the platforms are bigger than the player, plus I have no idea on how to do collision stuff. Any tips? Posted
  • #2 ✎ 251 ProKuku Avatar Taboo I didn't change my avatar for 180 days Website Final(?) Contest Runner Up I placed 2nd in the (possibly) final SmileBASIC Source Contest! October 2018 Programming Contest Cthulhu Join the cult Easter Eggs Hmmm it’s been a while since I’ve done something SB related on here... I’m assuming the platforms for your game are sprites? If so, you should be able to initiate collision-checking between the player and platforms simply by doing SPCOL player-sprite number SPCOL platform-sprite numberEDIT: you have to type SPCOL a whole two times 😰 Then, to do something (like keeping the player from falling) when the sprites actually collide, you’d write something like IF SPHITSP(1,0) THEN ... with the two numbers being the two sprites you want to check for collision with. This would be pretty inefficient, however, since you’d have to make sprites for each platform and put them precisely where you want. It would be better to put the platforms directly into your map (if you’re using one) and then figure out collision for the player and platform map tiles. Um anyway this has been going on long enough. Tell me if you’d like to try the slightly more complicated map-tile solution, or stay with the easier-to-understand solution with sprites for the player and platforms I think I used too many italics and bolds Posted Edited by ProKuku
  • #3 ✎ 6 Finnow Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies ah, so THATS how that works! Thank you very much! Also sticking to sprites but will ask for help with that if I end up needing it. Posted
  • #4 ✎ 6 Finnow Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies Ok so I’m trying to use Sphitsp in a while function, but it freezes the game. Any explanation for why this happens? WHILE SPHITSP[TILE,PLAYER] PLAYERYVOL=0.1 PLAYERY=PLAYERY+PLAYERYVOL WEND Posted Edited by Finnow
  • #5 ✎ 306 Minxrod Third Year My account is over 3 years old Website Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Video Games I like to play video games! Hobbies That will loop forever since nothing is changing the location of the sprites, so if the SPHITSPis false it stays false. (You might add a SPOFS into the loop, or just use an IF statement.) Posted Edited by Minxrod
  • #6 ✎ 6 Finnow Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies Ohhhh ok, now I feel dumb. Posted
  • #7 ✎ 251 ProKuku Avatar Taboo I didn't change my avatar for 180 days Website Final(?) Contest Runner Up I placed 2nd in the (possibly) final SmileBASIC Source Contest! October 2018 Programming Contest Cthulhu Join the cult Easter Eggs Also, don’t hesitate to ask another question if you have one. I know from experience that fixing one issue usually leads to 3 more popping up. Posted
  • #8 ✎ 6 Finnow Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies Well, there is one issue, but I have no idea how to describe it. You can’t jump when walking against a wall, or you fall as if you have a wall jump ready when moving at a wall but I have yet to implement wall jumps, I guess? Posted Edited by Finnow
  • #9 ✎ 251 ProKuku Avatar Taboo I didn't change my avatar for 180 days Website Final(?) Contest Runner Up I placed 2nd in the (possibly) final SmileBASIC Source Contest! October 2018 Programming Contest Cthulhu Join the cult Easter Eggs Hmm that does sound odd... the only thing I can think of is perhaps your wall collision is counteracting your jumping. Like when you walk into a wall you would do SPOFS X-1, Y or whatever it is. Then your jumping, though I don’t know how you’ve made it work, could be messing with that X-1 somehow. I’m not really sure, though, just a guess. Posted
  • #10 ✎ 6 Finnow Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Video Games I like to play video games! Hobbies Makes sense. Thanks! Posted