? Please help me with collision boxes (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Please help me with collision boxes

  • #1 ✎ 5 SuperBeefJerkey Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies I know how to resize and reposition sprites, and I know how to change their origin points, and how to detect collisions. All I need in that area now is to prepare a collision box of the right shape and size on a sprite that has been doubled in size and has had the point of origin adjusted. I'm trying to design a fight game without an 'HP' system. Posted
  • #2 ✎ 220 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength I think you can do something with SPDEF but I haven't messed around with that yet and I'm not sure what to do with that. Posted
  • #3 ✎ 1484 12Me21 Admin Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself Second Year My account is over 2 years old Website The collision box should be automatically adjusted with the sprite scale, as long as you enabled that option in SPCOL. You have to run SPCOL again after changing the origin point though. SPSET 0,0 SPCOL 0,TRUE SPSCALE 0,2,2 'collision box is updated automatically SPHOME 0,10,10 'collision box does not update SPCOL 0,TRUE 'updated Posted
  • #4 ✎ 220 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Huh never noticed that, could have been useful a while ago. Can SPDEF be used for creating a custom hitbox? Posted
  • #5 ✎ 5 SuperBeefJerkey Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Oh hey, thanks for the advice. I might have an opportunity to work on the program today. Speaking of which, I also need help with button controls. See, just doing this: IF BUTTON(2)==2 THEN MOVE=1 (Not sure if I typed that correctly, I'm on the spot) is ok if you're using only one button at once, but each different button throws a different number, and when more than one button is hit at once, the numbers are added together and the instruction doesn't work. I could use some advice on that, too. (Should I make that a separate post?) Posted Edited by SuperBeefJerkey
  • #6 ✎ 220 spaceturtles Video Games I like to play video games! Hobbies Avatar Block I didn't change my avatar for 30 days. Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength You're not doing it right. To accept button input do IF #WHICHEVER-BUTTON AND BUTTON(BUTTON-OPTION-NUM) THEN code... I.E. WHILE 1 CLS IF #A AND BUTTON(0) THEN ? "Pressed button A!" VSYNC WEND If you hold console button A it will print "Pressed button A!" for as long as you hold it. Posted
  • #7 ✎ 5 SuperBeefJerkey Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Drawing I like to draw! Hobbies Thanks a huge load!! During the life of Miiverse, a Japanese user had given me a piece of code that worked for one of my programs, but I didn't understand it so it didn't work for my other program. Looks like my fight games will finally start to come together! Posted Edited by SuperBeefJerkey