Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Boss Collision


giglamesh

Recommended Posts

mind you, you need to have certain 'mask' areas where Sonic can hit and where he can't on the boss.

and once he hits said mask, try doing it as if you just pressed the jump button - setting his y velocity to a sudden number and either randomizing the X values (between positive and negative). you know, if you want to keep sonic the hoghedge from jump spamming him automatically..

though i'm sure someone else could provide a better explanation.

Link to comment
Share on other sites

It would probably help if you showed us the shape of the boss so we can advice a specific collision system for it. If it's just a character-sized boss that can get hit from all sides, all you really need to do is negate your X and Y speeds when you hit him (unless, like Ryan said, you're coming from the top in case you want to randomize the X speed and give the Y a little umph to avoid killing him by bouncing on him repeatedly). Also don't forget to give the boss a small half-a-second period where Sonic can't hit or bounce off of him to avoid getting stuck in it.

Telling if you're colliding from above is pretty easy: you make sure Sonic's Y is less than the Boss's Y and you make sure Sonic's X is within a certain amount (approximately half the combined width of Sonic and the boss) of the Boss's X.

Link to comment
Share on other sites

Here's a simple way to do boss collision

if Player's CollisionBox Collides with the Boss' Collision Box:

Player.XSpeed=(Player.XPos-Boss.XPos)*BounceBackStrength

Player.YSpeed=(Player.YPos-Boss.YPos)*BounceBackStrength

end if

BounceBackStrength is usually a fractional value, since the speed would be too great otherwise. Play around with the value to get the optimum bouncing speed.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...