Problem with scroll

Discussion and feedback on Construct 2

Post » Thu Aug 24, 2017 9:42 am

Hello, in this capx the scroll first moves and then the objects that are not on the screen are deleted.
The problem is that you are deleting the wrong objects.
If you use wait the problem will solved but I can not use wait in my game.
Any way to solve this?

Objects should not be destroyed because the scroll was located there and the objects are inside the screen.

Image

Image

https://www.dropbox.com/s/5drp21dzlvkd8d0/scrollTest.capx?dl=0
B
31
S
13
G
21
Posts: 844
Reputation: 14,693

Post » Thu Aug 24, 2017 11:15 am

The Scroll actual happens in Post-tick.
After all it is 'drawing on the screen', so it happens when all the drawing is going on.

It updates its expressions during the tick, and maybe that is confusing.
I have no idea what the consequences are when it updates its expression after that the scroll happen (so in the next tick), for that i am not smart enough.
Plz do not ask me why, i dont know.

So, the destroy has to happen in the second tick.
But, you dont want the events to run on all sprites in that first tick.
Then may i propose this solution ?
https://www.dropbox.com/s/v64z29d0wjm2q ... .capx?dl=0

Not ideal, but it works.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Aug 24, 2017 12:33 pm

99Instances2Go wrote:The Scroll actual happens in Post-tick.
After all it is 'drawing on the screen', so it happens when all the drawing is going on.

It updates its expressions during the tick, and maybe that is confusing.
I have no idea what the consequences are when it updates its expression after that the scroll happen (so in the next tick), for that i am not smart enough.
Plz do not ask me why, i dont know.

So, the destroy has to happen in the second tick.
But, you dont want the events to run on all sprites in that first tick.
Then may i propose this solution ?
https://www.dropbox.com/s/v64z29d0wjm2q ... .capx?dl=0

Not ideal, but it works.


Thanks that is a valid mode if you do not need to do it at the first tick.
I discovered another way to do it at the first tick.

Image

https://www.dropbox.com/s/p05p2ltkhssb89e/scrollTest2.capx?dl=0
B
31
S
13
G
21
Posts: 844
Reputation: 14,693

Post » Thu Aug 24, 2017 12:40 pm

Ah yes, i should have realized the consequence when is stated "It updates its expressions during the tick".
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests