How do I make this work?

Get help using Construct 2

Post » Wed Mar 08, 2017 6:21 pm

How do I make my game scale by adapting to each screen and resolution? The problem is that in my game there are objects that when they touch a barrier that is hidden beyond the layout, are destroyed, and a life is lost. But I have the barrier outside the layout so it takes about 3 seconds from leaving the screen until it collides and the life is discounted. Is there any way to make it as soon as it leaves the frame of the screen you lose a life and destroy the object?
I also have problems with the loss of lives, I have brought the barrier in the window of sight to see when it crashed and destroyed the object but not lose a life. My event sheet is: sprite / on collision with "green" / subtract 1 from "life". And also I have a global variable "life: 3" assigned to a text box represented on the screen but what I say, no life is discounted ...
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 08, 2017 7:07 pm

JohnnyBeGood wrote:How do I make my game scale by adapting to each screen and resolution? The problem is that in my game there are objects that when they touch a barrier that is hidden beyond the layout, are destroyed, and a life is lost. But I have the barrier outside the layout so it takes about 3 seconds from leaving the screen until it collides and the life is discounted. Is there any way to make it as soon as it leaves the frame of the screen you lose a life and destroy the object?
I also have problems with the loss of lives, I have brought the barrier in the window of sight to see when it crashed and destroyed the object but not lose a life. My event sheet is: sprite / on collision with "green" / subtract 1 from "life". And also I have a global variable "life: 3" assigned to a text box represented on the screen but what I say, no life is discounted ...


In the behaviors you can set any sprite to be destroyed off the layout.Then you don't need your boundaries.

You can also do that in an event by checking if a sprite is outside the layout and destroying it.

You need to set your life text to the variable you use for life without quotation marks to see the lives number.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Wed Mar 08, 2017 7:28 pm

lamar wrote:
JohnnyBeGood wrote:How do I make my game scale by adapting to each screen and resolution? The problem is that in my game there are objects that when they touch a barrier that is hidden beyond the layout, are destroyed, and a life is lost. But I have the barrier outside the layout so it takes about 3 seconds from leaving the screen until it collides and the life is discounted. Is there any way to make it as soon as it leaves the frame of the screen you lose a life and destroy the object?
I also have problems with the loss of lives, I have brought the barrier in the window of sight to see when it crashed and destroyed the object but not lose a life. My event sheet is: sprite / on collision with "green" / subtract 1 from "life". And also I have a global variable "life: 3" assigned to a text box represented on the screen but what I say, no life is discounted ...


In the behaviors you can set any sprite to be destroyed off the layout.Then you don't need your boundaries.

You can also do that in an event by checking if a sprite is outside the layout and destroying it.

You need to set your life text to the variable you use for life without quotation marks to see the lives number.

done. but now those objects are now spawning...
B
5
Posts: 31
Reputation: 291

Post » Wed Mar 08, 2017 9:02 pm

Sprite > is on screen (invert the condition by right clicking on it)
________Sprite > destroy
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Mar 12, 2017 2:10 am

99Instances2Go wrote:Sprite > is on screen (invert the condition by right clicking on it)
________Sprite > destroy

still not spawning :roll:
B
5
Posts: 31
Reputation: 291

Post » Sun Mar 12, 2017 2:30 am

add instance var of 0 by default

sprite is on screen
trigger once
> set instance var to 1

is not on screen
and var = 1
> sprite destroy


if somebody offers a better way then do that, because i think even if you include the "trigger once" condition it's still going to be constantly setting the var to 1.
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Sun Mar 12, 2017 3:26 am

I would need to see your capx to tell what you have going on.

Hard to trouble shoot without that.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825

Post » Sun Mar 12, 2017 5:26 pm

lamar wrote:I would need to see your capx to tell what you have going on.

Hard to trouble shoot without that.

its very simple. it's an enemy that spawns and starts moving forward, and once it is off the screen i need him to be destroyed and player loose a life
B
5
Posts: 31
Reputation: 291

Post » Sun Mar 12, 2017 10:08 pm

So, you create them off screen. They move in view, and then they sneak off screen. The second time they go off screen, you want to destroy them.

That, or the spawning has a flaw (well, that is a blemish in the spawning too).

Your really need help ? Spawn your capx in a sharing site. Ty.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Mar 12, 2017 10:13 pm

99Instances2Go wrote:So, you create them off screen. They move in view, and then they sneak off screen. The second time they go off screen, you want to destroy them.

That, or the spawning has a flaw (well, that is a blemish in the spawning too).

Your really need help ? Spawn your capx in a sharing site. Ty.

i got it to work! thanks all!!!
B
5
Posts: 31
Reputation: 291


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests