How do I spawn objects?

Get help using Construct 2

Post » Tue Mar 11, 2014 9:17 am

Hi,

I have two problems so far that I can't solve:

- I would like to know what to write at create object action, to spawn the objects at the borders of the screen, e.g. for size 1024, 576.

- When the objects are created I would like them to go to the position of the player and keep a specific distance.

Sorry for asking two questions in one post.
Thank You, in advance!
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417

Post » Tue Mar 11, 2014 9:22 am

No problem for the two questions ! You should read the basics of C2 :)
https://www.scirra.com/tutorials/37/beg ... onstruct-2

1 - You can use the action "create object" and fill the "X" and "Y" parameters with the position wanted. You can access the window size with the system expression windowWidth and windowHeightv(https://www.scirra.com/manual/126/system-expressions).

2 - Add the pathfinding behavior or the MoveTo behavior to you object, then when you spawned it set the target to the player.
B
39
S
15
G
5
Posts: 295
Reputation: 6,089

Post » Tue Mar 11, 2014 9:24 am

Would you like to create them on screen or offscreen?
You'd probably want to randomize it as well, right?


Giving them bullet behaviour and setting the angle towards the player would work for the second question?
Just have to set it so that when the distance between the player and the object is a specific amount you set the bullet speed to 0..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Mar 11, 2014 9:30 am

Yeah sorry for not clarifying that, I want them to spawn randomly at the borders of the screen(Inside the layout).
So, in the create event X,Y, what should I write?

Thanks
@coyowl

coyowl.com

Game studio with a portfolio of 3 Apple Featured games.
B
31
S
7
G
2
Posts: 111
Reputation: 2,417


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests