Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

X/Y Collisions by points

Ok, I'm trying to detect X/Y by points on a character, they're 3 points/

-top
-middle
-bottom

if I hit the enemy on the top it moves diagonal(direction).
if I hit the enemy on the middle it moves the opposite direction
if I hit the enemy on the bottom it moves opposite from the top point.

Any ideas?
 
You are, I take it, using some kind of ABS? Without knowing that, it's hard to give a specific answer, but in general, the answer would be something on the order of "Set Move Route-- Move Away from Player," (Turning off Move Animation and turning on Direction Fix) or perhaps Conditional Branches based on the comparative X and Y coordinates of enemy and player.
 
Assuming you are always facing the enemy when you hit him, you could make an assumption that if the player is facing left, the enemy will move left.

Code:
Conditional Branch: Player is facing Left

  Set Move Route: This event

                    Move Left
 
No No, I know all the event stuff that deals with the movement, I just need help finding the X/Y.

Here's a picture example.
2niabud.png


Each box represents a pixel collision point, if my character attacks one of those boxes that determains the direction the ai moves back.
 
Each attack is represented by an event"which is called uppon the attack", if the attack mask for this instance is melee and it hit's one of those points the enemy will move back repectively.

If I use melee it calls the melee attack mask event which is right in front of the enemy kicking/punching the enemys ass!

I'm also using Fotz's pixelmovement script, so you can hit any of those three points while you couldn't with tile movement.
 
Oh, I just posted.

Yes, the abs is event based since it's based on snes/gba systems which the pixelmovement script is enough for the system, everything else is evented.

If I press "Z" Melee key an event is called to the heros X/Y and if that event touches one of those 3 spots the enemy either goes.

-Diagonal/Up
-Opposite Direction
-Diagonal/Down

I'm using Fotz's pixelmovement script.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top