Multiple collision detection zones and AI

SimonMWSimonMW Member Posts: 3
edited November -1 in Working with GS (Mac)
I have just downloaded Game Salad. I was wondering whether it would ever be possible to assign multiple collision detection zones to Actors and connection to things like damage/energy bars? For example so that if you had a spaceship and it was hit by an object on the left hand wing you would change to a different sprite showing a damaged left wing and a small amount of reduction to an energy bar.

But if the enemy hit a collision point on the front of the ship the ship could suffer more damage to the energy bar and show a different damaged sprite.

Also, are there any plans to make any enemy AI parameters available?

Something else that would be cool is to be able to display different animations based upon what the enemy is doing, and which key you are pressing.

For example, if the enemy did X animation and was within N number of pixels distance of the players Actor, or hit a defined collision zone and the player is pressing Y button at the time, then the players Actor should perform Z animation. This could also be connected to things like scores or damage bars etc.

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Hi SimonMW,
    Welcome to GameSalad.

    There are a couple of ways you can "detect" which direction you collide with another object.

    Multiple actors: You could have multiple actors that represent each side of the ship. When each one collides with an object, you would set one of several game(global) attributes showing where the collision happened. Then on your ship actor, it would read that game attribute and adjust accordingly. Likewise, the energy bars would also have rules depending on which actor set game attribute was set. However you would need to have those actors follow the main ship actor and adjust their position as needed. If your ship rotates, then that will just be more logic to determine the collision actors' relative location.

    Tracking Ship position: If your ship doesn't rotate, then you can just have the logic of collision tracking in the objects colliding with the ship. The ship would constrain its location to game attributes so other actors can see where it is. Then for the enemy, if it collides with the ship, it could see where it is relative to the ship when it collides and set the game attributes for which direction it struck from.
  • SimonMWSimonMW Member Posts: 3
    Thanks CodeMonkey much appreciated. Although I was also thinking in terms of wider application too, for example a fighting game where multiple collision areas may be needed.

    Earlier on I thought of perhaps another way of using GameSalad. Would it be possible to get a basic game outline up and running, then convert to be able to see it in X Code and finish it off with more complex features that Game Sald doesn't allow? That could really speed up development on more complex projects. You could perhaps sell a separate developer version of GameSalad that allows this usage out of the box?
  • sbartsasbartsa Member Posts: 43
    better late than never..... lol

  • DimensionGamesDimensionGames PRO Posts: 993
    please don't bring back old threads. Im sure they would have seen this video.

    Cheers.
Sign In or Register to comment.