How do I spawn random layouts and destroy them?

Get help using Construct 2

Post » Thu Mar 27, 2014 5:31 pm

I have an End Less Runner game,
All events are in main layout, and I have at least 50 more layouts as levels.
Now I want leyouts come in main layout (random) befor Runner(camera) rich the place and then get distroy after past the camera, then they get back to random list again.
There must be no delay .
What can I do ?
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 7:57 am

Is there any way to call layouts come true ( by random) after first layout?
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 1:43 pm

Could you not use system choose(layout1,layout2,etc,etc)? then store it and then call it?
B
14
S
6
G
3
Posts: 83
Reputation: 4,228

Post » Fri Mar 28, 2014 4:09 pm

@LI0NHART : I dont realy undestand what do you mean! This is my capx file, maybe It can help!
Code: Select all
https://app.box.com/s/924iazmpg5p58hnenta0


@shirokuma : Can you help me to do this please?
Also I wana make sprite4 to not jumpable, when player jumped from it, then die!
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 4:27 pm

Ok, so you can't really spawn a layout in another layout, because that's not what layouts are for..
layouts are like different rooms. You can go from one room to the other, but not create a room within a room.
You can ofcourse create the objects in your event-sheet placed like you have in the other layout.
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 » Fri Mar 28, 2014 4:35 pm

@LittleStain As you can see there is a bunch of cractors in layouts, how can I manage them all in main layout (layout1) by random and keep all caractors in exact place (x,y).
There has to be a short way to do!
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 4:50 pm

My way of doing it, which might still be a bit difficult, would be creating the objects from arrays with a single function.
It seems your layouts are grid-based, so recreating them inside an array to determine what goes where should be relatively easy.
Then just call a function to create a layout offscreen based on the grid of a random array..
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 » Fri Mar 28, 2014 5:08 pm

@Mazdakfx
Is this layout change fast enough? Just let the character run. You will see a little blue box. Let the player hit the box.

I didn't change too much in you code. I'm not certain why some things were done they way that they were, so I didn't want to change things until I understood your code better.
You do not have the required permissions to view the files attached to this post.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Fri Mar 28, 2014 5:19 pm

@shirokuma
Thanks for your reply.
This is a test code, so the things are there untill get complete.
I want the layout change without delay and also by random.
In your code player just goes to other selective layout and there is also a delay!
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 5:22 pm

@LittleStain
Thanks for your reply.
About using array I have to say this objects are not all objects I wana use in game. There has to be more, so it's realy dificult to use aray and get them point one by one!
B
7
S
1
Posts: 53
Reputation: 545

Next

Return to How do I....?

Who is online

Users browsing this forum: adventurist, Blendi1223, Lancifer, landily, leonardoer1, newt, PROxMTswatTR, ST314 and 20 guests