use loop to fill screen with sprites. How to "wait"?

Get help using Construct 2

Post » Tue Feb 10, 2015 11:24 am

@Codah
Haha, yes welcome to my world. ;)

What my intention is to fill the screen randomly but not entirely random.

For every ROW I want ONE tile to be added in a random position on that row.
Repeat down the rows, and then start again from top, until the screen is filled.

That was my intention.

My idea of line 4 btw was to fill it with numbers (01234, 01234.... etc) but it is not needed because it is temp! so, removed.
Last edited by helena on Tue Feb 10, 2015 11:32 am, edited 1 time in total.
B
54
S
17
G
11
Posts: 430
Reputation: 9,450

Post » Tue Feb 10, 2015 11:31 am

Oh so the problem lies with the timer? Enable them wrong order? Hmm.
I have to confess that I haven't wrapped my mind around the algorithm for the timer. ;)

EDIT: I figured it out, the algorithm was too convoluted. I borrowed the variable TileNumber (which is just a number that is counting up) and divided with 250, and it works now.

whew.
Last edited by helena on Tue Feb 10, 2015 11:41 am, edited 2 times in total.
B
54
S
17
G
11
Posts: 430
Reputation: 9,450

Post » Tue Feb 10, 2015 11:39 am

@codah @somebody
Latest file, it is working now as it should. What do you think?

Do you think this is device independent speed?
You do not have the required permissions to view the files attached to this post.
B
54
S
17
G
11
Posts: 430
Reputation: 9,450

Post » Tue Feb 10, 2015 11:48 am

Tried this?
You do not have the required permissions to view the files attached to this post.
ImageImageImageImage
B
154
S
61
G
40
Posts: 2,574
Reputation: 33,783

Post » Tue Feb 10, 2015 12:55 pm

Seems to work - but in a final version would it show a "proper" level like this or is the effect just for randomly filling a screen with tiles?
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Tue Feb 10, 2015 2:19 pm

@Somebody
A proper level, yes.
Either by starting with empty level (just showing the background texture) and fill it with the parts (tiles) to form the level. OR start with a solid slowly down-scrolling wall (of maybe the "B" chocolate tile) and knock it off tile by tile to reveal the level tiles behind. (This second one is more like BoulderDash original, so it might be too close to be homage) <---- Somebody btw, the Fade behavior and the Scroll Effect aren't playing well together. I won't be using together, but I noticed it when I tested.

@shinkan
Without actually testing the code, I have a feel this would just show any tile at random, right?
I kind of want to have the ordered random-ness, row by row. to make it random but not entirely random.(entirely random could cause to happen to clump in one part of the screen and empty in other)

And... THANK YOU!!!!!!
B
54
S
17
G
11
Posts: 430
Reputation: 9,450

Post » Tue Apr 21, 2015 11:49 pm

The timer approach looks horrible to me, keep storing the dt on the timer variable just to run a few loops. There must be another solution.
Image
B
14
S
4
G
4
Posts: 134
Reputation: 3,152

Post » Wed Apr 22, 2015 2:53 am

Just figured out a better solution, you can create a recursive Function this way:

Image
RecursiveLoop.capx
Image
B
14
S
4
G
4
Posts: 134
Reputation: 3,152

Post » Wed Apr 22, 2015 4:05 am

@hazneliel

Oh wow this has been a while ago. Thanks for your addition. I don't work with C2 right now, swamped with other works. But i will try to remember your post when I do comeback. ;)
B
54
S
17
G
11
Posts: 430
Reputation: 9,450

Previous

Return to How do I....?

Who is online

Users browsing this forum: Cryttexx, KNTMartin, ridhoemgl, Unconnected and 5 guests