How do I spawn random layouts and destroy them?

Get help using Construct 2

Post » Fri Mar 28, 2014 5:28 pm

Not really difficult in my opinion, just use a number for every different kind of object you'd like to create in the array and use the position in the array to determine the place in the grid to spawn the object..
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:51 pm

Here it is going to random Layouts. I removed everything from the Layouts as any difference between where you leave a layout from where you enter a layout will make it obvious. There is still a flicker in the player, but that could be handled by getting the animation number from the sprite when it leaves a layout and starting it on the the next frame in the next layout.
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 7:19 pm

@shirokuma
Excellent job, well done! Thank you.
As you said just need to check animation frame on collision with exit1 and +1 in next level, correct?
But How to do that?!

.
Last edited by Mazdakfx on Fri Mar 28, 2014 7:56 pm, edited 1 time in total.
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 7:56 pm

@Mazdakfx
Yes, I think the animation starting from 0 as it enters a new layout is causing some of the player flicker. You probably also want to make sure that the player sprite is the same Y value in relation to the floor in each of the layouts.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Fri Mar 28, 2014 7:59 pm

@shirokuma
I did understand about player sprite Y position in each layout. Just don't know how to check animation frame on collision with exit sprite!

.
B
7
S
1
Posts: 53
Reputation: 545

Post » Fri Mar 28, 2014 9:12 pm

@Mazdakfx
Here is getting and setting the animation frame. It's not quite right. I'm not adding the 1 frame at this point as if the sprite happened to be on the last frame when it hit the blue box just blindly adding 1 to the frame might cause a problem. So there will need to be a little more logic added. I'm at work right now so I don't have time to mess with it. I'll let you play around with it. ;)
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 10:15 pm

@shirokuma
Thank you very much. I'm working on it and let you know what I get.
B
7
S
1
Posts: 53
Reputation: 545

Post » Sat Mar 29, 2014 4:44 pm

@shirokuma
I checked it more and more, when sprite goes to next layout, animation frame get change and frame number is same as when it leaves last layout, but animation get start over from begining!
B
7
S
1
Posts: 53
Reputation: 545

Post » Sun Mar 30, 2014 12:09 am

Well... the concept seems to work.
I stripped everything out and precisely placed things with numbers and the transitions seem seamless to me. See what you think.
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 » Sun Mar 30, 2014 5:42 am

@shirokuma
It's realy great, You realy care about new challenge and it's absolutly helpful and I appreciate that.
One more thing I'm wondering and it's realy important!
It's a runner and jumper player, when it changes the layout Y is fix so it can't jump at that moment even if it was jumping, it has to start over on the floor! Is there any way to keep player's Y on next layout and continue game?!
B
7
S
1
Posts: 53
Reputation: 545

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 59 guests