Spawn object at middle of each layer boundaries

Get help using Construct 2

Post » Mon Jan 30, 2012 6:03 pm

I want do spawn an object in these positions:


y = 0; x = WindowWidth/0 (Middle Top)

y = WindowHeight/2; x = 0 (Middle Left)

y = WindowHeight/2; x = WindowWidth (Middle Bottom)

y = WindowHeight; x = WindowWidth/0 (Middle Right)

Now I'm doing this:

Set Position at x = choose(WindowWidth/2,choose(0,WindowWidth)); y = choose(choose(0,WindowHeight),WindowHeight/2)

The problem is that this arrangment includes also 0,0 and WindowHeight,WindowWidth (Top Left and Bottom Right corners).

How can I achieve what I want? Does an IF condition exists somewhere for actions?
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Jan 31, 2012 9:47 am

It also spawn at the center of the stage (clarification to give the thread another chance.. :-P)
B
29
S
9
G
6
Posts: 525
Reputation: 8,294

Post » Tue Jan 31, 2012 10:33 am

Last edited by Yann on Sun Sep 14, 2014 9:47 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Tue Jan 31, 2012 11:09 am

Wow, never thought about it! Thanks, really much appreciated
B
29
S
9
G
6
Posts: 525
Reputation: 8,294


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Google [Bot], makkancs and 35 guests