? SP to SP collision (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Another contest? You asked for it!

SP to SP collision

  • #1 ✎ 119 ChaseCZ Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself How do i make a simple sprite to sprite collision from all sides? (I actually need only bottom but just for more info i want to know all of them) Posted
  • #2 ✎ 49 kitesinpowerlines Avatar Block I didn't change my avatar for 30 days. Website Avatar Embargo I didn't change my avatar for 90 days Website Avatar Taboo I didn't change my avatar for 180 days Website This is kind of a confusing question. Do you mean that you need to check if collision happens on a specific side of the sprite? Posted
  • #3 ✎ 119 ChaseCZ Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Yes Posted
  • #4 ✎ 49 kitesinpowerlines Avatar Block I didn't change my avatar for 30 days. Website Avatar Embargo I didn't change my avatar for 90 days Website Avatar Taboo I didn't change my avatar for 180 days Website Hmm... that could be difficult. If you are only checking for one direction you could set the point of origin slightly below the sprite, but this may cause issues with rotating, scaling, BG collision etc. SPSET 0,496:SPHOME 0,8,16 This can also be done by redefining the sprite: SPDEF 496,U,V,16,16,8,16 Another way you could do this is set transparent sprites around the sides of the main sprite and check their collision. X=200:Y=150 SPSET 0,496:SPOFS 0,X,Y:SPHOME 0,8,8 FOR I=1 TO 4 SPSET I,0:SPCOLOR I,RGB(0,0,0,0)'You may be able to use SPHIDE instead, but I'm not sure if collision happens when the sprite is hidden. SPCOL I:SPLINK I,0 NEXT SPOFS 1,X,Y-16:SPOFS 2,X+16,Y:SPOFS 3,X,Y+16:SPOFS 4,X-16,Y I am not too confident in my code because I am away from my 3DS, but perhaps someone else will verify or provide a better procedure. Posted Edited by kitesinpowerlines
  • #5 ✎ 119 ChaseCZ Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Video Games I like to play video games! Hobbies Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Yeah, i tried one of these but perhaps i got them wrong, so i'll try it again and collision doesn't happen when a sprite is hidden. i can just make a blank sprite (no color) and then scale it how i need Posted Edited by ChaseCZ