Sign In

Please help me with collision boxes

#1✎ 15SuperBeefJerkeyIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthDrawingI like to draw!HobbiesAvatar EmbargoI didn't change my avatar for 90 daysWebsiteI 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 8 months ago

#2✎ 309spaceturtlesVideo GamesI like to play video games!HobbiesAvatar BlockI didn't change my avatar for 30 days.WebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthI 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 8 months ago

#3✎ 162912Me21Head AdminThird YearMy account is over 3 years oldWebsiteSyntax HighlighterReceived for creating the code syntax highlighter on SBSNight PersonI like the quiet night and sleep late.Express YourselfThe 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 8 months ago

#4✎ 309spaceturtlesVideo GamesI like to play video games!HobbiesAvatar BlockI didn't change my avatar for 30 days.WebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthHuh never noticed that, could have been useful a while ago. Can SPDEF be used for creating a custom hitbox?
Posted 8 months ago

#5✎ 15SuperBeefJerkeyIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthDrawingI like to draw!HobbiesAvatar EmbargoI didn't change my avatar for 90 daysWebsiteOh 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 7 months ago
Edited 7 months ago
by SuperBeefJerkey

#6✎ 309spaceturtlesVideo GamesI like to play video games!HobbiesAvatar BlockI didn't change my avatar for 30 days.WebsiteIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthYou'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 months ago

#7✎ 15SuperBeefJerkeyIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthDrawingI like to draw!HobbiesAvatar EmbargoI didn't change my avatar for 90 daysWebsiteThanks 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 7 months ago
Edited 7 months ago
by SuperBeefJerkey