How to make monsters walk towards a player?

PTIGameStudiosPTIGameStudios Member Posts: 16
edited November -1 in Working with GS (Mac)
How do i make monster's walk towards a player? My gaming club and I are making a zombie side view shoot em up game and we have walking working and everything. Now we have it so you can walk back and forth but how do i make it so the monsters i place in the level automatically walk towards him. Once they get to him they hit him so i need code to trigger that animation and then i need to set up a health bar.

Can you give me some video reference? I can't use youtube because I'm at school and they have it blocked so if you can somehow give me the video somewhere else like if you download it with a downloader and upload it to a website with html5 or something i can watch it...

I know I'm asking a lot of you but i just need these videos :S

I CAN view youtube mobile so you can give me links to that...

Comments

  • OkyshoOkysho Member Posts: 158
    Tshirtbooth has a tutorial on how to use the Magnitude Function to measure the distance between two actors. You basically want to store this into an attribute and use it in your rules for determining when it's good to move towards the player.

    A gaming club sounds like fun.

    Edit: If you don't know how to do that, you'll probably have another check within that rule to determine which way he'll move based on the player's position.

    If you haven't already, make a two real global attributes for your main character's X and Y values

    double edit: The demo isn't a youtube video, it's actually a gamesalad demo.

    If you can't find it, you're going to have this is a constrained attribute [Distance from = Magnitude (self.position x - game.playerx , self.positiony - game.playery)

    This will keep track of the distance X and y between your zombie and the player and store it in the local attribute "distance from" (you need to make this obviously)
Sign In or Register to comment.