mercredi 7 décembre 2016

Instance spawned to follow the instance that spawned it and as a result to behave in a certain way?

As mentioned in a previous question, I am working on a small side-scrolling space shooter. I've been trying to implement weapons attached to various ships. There are a few things that I want to be done veeery specifically:

1) Each different kind of ship (different objects/symbols) to be spawned in by each ship in a layer behind or in front of the ship.

2) The weapon should follow locally to the ship that spawned it and it should stay local to that point from which it was spawned from the ship (e.g. so, if the weapon was spawned in ship.x+8 and ship.y-4, it would need to stay relative to this position of the ship that spawned it in). Essentially, probably being parented as a child of the ship that spawned it or something along the lines.

3) For the weapon to act differently depending on which type of ship spawns it in (i.e. player ship or an enemy ship). This would require the code to check whether the weapon was spawned by a player ship or an enemy ship.

So, these are my three questions on how I want it to work or at least what I want to achieve. It's the biggest wall for me at the moment. I'm working with acripscript-3 and in flash, in case you haven't noticed the tags yet.

Aucun commentaire:

Enregistrer un commentaire