Debug Layout

Get help using Construct 2

Post » Sat Feb 22, 2014 9:39 am

Hi all,
I have started to to play with the debug thing.It's cool.
But I noticed some weird thing.
I have an event which spawns a sprite very 0.1 secs but it will be destroyed after fading out(Fade out behaviour enebled)
So I would have an average of 20 objects on the layout all the time.But it occasionally rises to 200 objects and falls suddenly.
Why is this?
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sat Feb 22, 2014 10:22 am

any chance you can post the capx ?
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Sat Feb 22, 2014 12:11 pm

@RamPackWobble
Capx....umm...uhh....I will show you a Video :D
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sat Feb 22, 2014 2:24 pm

Actually I was thinking that there was something in the code that was causing this spike...

Can't tell from a video :)
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Sun Feb 23, 2014 10:50 am

Ok.Wait,I will go home and PM you the capx. :)
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Feb 23, 2014 2:15 pm

@RamPackWobble
Found the bug.First see this capx.Don't bother about the code and all.
I have just included some backgrounds etc and some more maps.(and some sprites named obstacles) in my actual game
So this is the area where the bug is.
Image
Whenever a new obstacle is added by this code,The object count increases.I think the object is spawned every tick.How do I make it right?Trigger once?If I put that,The obstacle would appear just once and never appear again,(The maps are randomly created,see the capx)So If the trigger once is added,It will trigger just once and never again.I want the sprite obstacle to be present in all the instances maps it's assigned to.
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Sun Feb 23, 2014 7:24 pm

if I understand you correctly:

you want to go through each map (1,4,7,10,and 12 (and there might be , for example, 5 lots of map01)) once (and only once) when the score gets above 5 ?

if so then (I think) all you need is on your event

System : Score>5

a second condition

system : Trigger once
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Mon Feb 24, 2014 8:54 am

RamPackWobble wrote:if I understand you correctly:

you want to go through each map (1,4,7,10,and 12 (and there might be , for example, 5 lots of map01)) once (and only once) when the score gets above 5 ?

if so then (I think) all you need is on your event

System : Score>5

a second condition

system : Trigger once

No.I have just one map01.
Look at the capx.There are two maps in total(That is randomely spawned)
Once the last map reaches 0.5*self.width, another map is randomly chosen and spawned next to it.

If the score is above 5,I want the obstacles to be always present whenever the map is spawned.
(Hope I made it clear enough)
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Post » Mon Feb 24, 2014 9:40 am

Give each map an instance variable/ boolean that you can use to see if that map has already spawned a new map. Then you just need to add a condition below the "have I travelled more than half way yet ?" saying "If I have not yet created a new map do so but remember I have already done it so I don't do it again"

Image

https://dl.dropboxusercontent.com/u/143636437/examples%20for%20web/harry%20potter%20test.capx
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Mon Feb 24, 2014 11:13 am

ah.I don't understand.What I'm trying to do is,to create a sprite object on the map(map1 for example)
That is after Score reaches 5.Once score reaches 5,the sprite should always spawn with the map.
See this Capx
.Everything is like what I want.Sprite "hangskeleton" is spawned whenever map 1 is spawned.I want the sprite to spawn once for each map01 spawned.But it appears that skeleton is spawned every tick.
B
11
S
5
G
2
Posts: 496
Reputation: 2,306

Next

Return to How do I....?

Who is online

Users browsing this forum: FabianB and 12 guests