Triggering Spawn by X alignment problem

Get help using Construct 2

Post » Fri Nov 09, 2012 5:32 am

OK, here's what I'm trying to do. I'm trying to spawn an object (transparent targeting graphic) on an enemy fighter ship. The game is top down similiar to the "space blaster demo game". When the Player(palyerShip) is in direct X alignment with an enemy ship, I want the spawned image to appear. I tried the following:

Enemy1 > (Compare X) > X=Player.X Event:Enemy1 Spawn Taregetting Graphic

But nothing happens...
Either I'm doing something wrong or there has to be another way.
Image
B
71
S
22
G
2
Posts: 671
Reputation: 8,522

Post » Fri Nov 09, 2012 5:54 am

Well your Theory/Psuedo code is correct..It should work

A few other things to check would be Z order Make sure that you are spawning the object on the right layout and that its visibility is properly set..
Try spawning the object somewhere else first using the same code...and If it appears then its most likely just behind the Enemy1.sprite
You can add a small code directly after the spawn that is
Targeting Graphic->Move to top of layer

try that...there could be a few other problems but that is what I would try first..

its not the only way to check X though...
you could also do something like

Every Tick-> System(Compare two values)Player.X = Enemy1.X
Action->spawn Targeting Graphic at Enemy1.(image point)


hope that helps

When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
29
S
11
G
8
Posts: 312
Reputation: 7,333


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 19 guests