How do I spawn an object?

Get help using Construct 2

Post » Thu Apr 06, 2017 7:09 pm

hi! so i have a layout size (1200x800)and a window view (600x400)smaller than the layout size so i was wondering how can i spawn an object inside the windows view. im asking this cause i tried to use spawn object>randomx(0,800), random y(0,1200) but the thing is that thera are some object spawning outside the window view so they are not visible to the player. id like to make them spawn always randomly inside the window view no matter its size (cause its a scalable window view and depending on the smarthphone id be bigger or smaller)
help. thx.
B
5
Posts: 31
Reputation: 291

Post » Thu Apr 06, 2017 7:46 pm

use the camera.

create object at (camera.x + random(-window_width / 2, window_width / 2), camera.y + random(-window_height / 2, window_height / 2))
B
6
S
2
Posts: 61
Reputation: 1,099


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Lordshiva1948 and 16 guests