トピック
Chickens32 Chickens32

Help! Collision!

O.K., I know collision, such as fighting or talking with people, but how do I make it so that if I were to run into, say, a building (screenshot) I wouldn't run through/over it? Is there any solution?
2そうだね
プレイ済み
返信[1]
親投稿
Otacon otacon420
im just starting with smilebasic today myself, but does your bg objects have bounding boxes? im assuming your player will, lets say your bg object does, and that you bg objects bounding box would be checking y+1(bbox_bottom) and your player would be checking y-1(bbox_top). anyways if these two are true i would set your vspeed to 0, hspeed dont change and add an else statement for moving down
0そうだね
プレイ済み
返信[2]
親投稿
Otacon otacon420
so the logic would be if player bbox_top and bbox_bottom wall and up and !down, vspeed equal 0 else if down, vspeed equals -2 or whatever
0そうだね
プレイ済み
返信[3]
親投稿
Scientist Speedy1101
The higher a sprite number, the more on top it's going to be.
0そうだね
プレイ済み