giglamesh Posted August 18, 2009 Report Share Posted August 18, 2009 i use MMF2, i was just working on how to make the character (sonic) hit a boss and then bounce off like he does. would i have to add an event where he bounces off in a certain direction, or would i have to make changes to the boss itself? thnks in advance Link to comment Share on other sites More sharing options...
Ryan Cordel Posted August 18, 2009 Report Share Posted August 18, 2009 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 More sharing options...
Kain Posted August 19, 2009 Report Share Posted August 19, 2009 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 More sharing options...
The Taxman Posted August 20, 2009 Report Share Posted August 20, 2009 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 More sharing options...
Damizean Posted August 20, 2009 Report Share Posted August 20, 2009 Perhaps he could just normalize the penetration vector and use the speed as bounce strength. Link to comment Share on other sites More sharing options...
Recommended Posts