How do I spawn it ou of the screen regardless of resolution?

Get help using Construct 2

Post » Wed Aug 13, 2014 4:09 pm

shinkan wrote:Do you want to spawn them on specific places over the layout? or just wherever but outside windows size?

Left and Right outsides of the screen
B
12
S
3
G
1
Posts: 80
Reputation: 2,109

Post » Wed Aug 13, 2014 4:11 pm

Sisyphus wrote:Here the capx example, it work's the way you describing it.

Mmm, in your example it seems to work correctly.. Strange.. I'll give it another try and check if it works now
B
12
S
3
G
1
Posts: 80
Reputation: 2,109

Post » Wed Aug 13, 2014 4:14 pm

Hmm, If I understand it correctly you need to spawn them just outside the window, doesn't spawning them at let's say Player.X + windowWidth solve the problem? How exactly do you want them to spawn?
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Wed Aug 13, 2014 4:23 pm

caiorosisca wrote:Hmm, If I understand it correctly you need to spawn them just outside the window, doesn't spawning them at let's say Player.X + windowWidth solve the problem? How exactly do you want them to spawn?

Yes, and I used to use this method, but I discovered that if I resize the browser window, changing the windowWidth, it begins to spawn incorrectly, since it begin smaller/bigger, the point is changed, understood?
B
12
S
3
G
1
Posts: 80
Reputation: 2,109

Post » Wed Aug 13, 2014 4:33 pm

"viewportleft - something" and "viewportright + something" should work as expected..
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 » Wed Aug 13, 2014 4:34 pm

Sisyphus wrote:Here the capx example, it work's the way you describing it.

Man! I discovered what I was doing wrong! First I was using X=player.X+ViewportLeft, making the enemies spawn on screen AND in the Right side, after I changed it to X=player.X-ViewportLeft, making the enemies spawn in the left side BUT alot far in the Layout...
The thing is, I just need to use X=ViewportLeft, I don't need to use the player.X, that's why it was spawn far in the Layout :lol: But now I got it fixed, Thanks man, U helped me to see that mistake!
B
12
S
3
G
1
Posts: 80
Reputation: 2,109

Post » Wed Aug 13, 2014 4:39 pm

alan349 wrote:I've already tried viewpoRight and Left, but the Left one don't seem to work correctly, spawning the enemies at a fixed point only...

I've upload the capx above, it spawns the sprite outside the screen, just move the blue square right then tap it and see, red square spawns outside the left viewport. Viewport left works correctly.
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Post » Wed Aug 13, 2014 4:44 pm

alan349 wrote:Man! I discovered what I was doing wrong! First I was using X=player.X+ViewportLeft, making the enemies spawn on screen AND in the Right side, after I changed it to X=player.X-ViewportLeft, making the enemies spawn in the left side BUT alot far in the Layout...
The thing is, I just need to use X=ViewportLeft, I don't need to use the player.X, that's why it was spawn far in the Layout :lol: But now I got it fixed, Thanks man, U helped me to see that mistake!

Glad to help :lol:
B
22
S
9
G
7
Posts: 421
Reputation: 6,543

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests