How do I Procedurally Place Tiles For Infinite Level

Get help using Construct 2

Post » Mon Oct 12, 2015 7:44 pm

I would make a tile level editor for the sections that plots everything to an array. Then i would save the rooms array as .JSON strings so i could re-draw the arrays later.

Durring the game run time you draw the arrays off the right side of the screen as needed. When the rooms are less than the left side of the viewport, then destroy them.

When the player scrolls too far from X=0 things will start getting shaky, so I suggest giving the player a break to review the score, while you reset the map and the player position.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Mon Oct 12, 2015 9:40 pm

@jojoe

How would I import my assets into C2 to make this array?

Should I import my level layers as animation frames?

Or would the layouts work?

I can build multiple layouts in C2 using a tilemap and these layouts can be my level sections, I can then make a main layout for my game and use the other layouts as my level sections and just generate them that way
B
9
S
3
Posts: 45
Reputation: 770

Post » Mon Oct 12, 2015 10:35 pm

You should chop your concept levels into small bit sized pieces, and make a tilemap:
https://www.scirra.com/manual/172/tilemap

Things the player interacts with, like if they break the vases, should be imported as sprites. This way you can make cool physics objects or add animations if needed.

you will need to make an in game editor, so you can draw the rooms back, and record the tile positions.

After you make the rooms you want you can export the tilemap as JSON data. You can save this single room in an array objects slot.

When it comes time to draw a room, you simply randomly pick a number, and dump that arrays index number to fetch back the JSON to load back into a tilemap object to re-draw whichever room you made.

When a tilemap goes off the screen to the left destroy it.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Mon Oct 12, 2015 10:38 pm

Sorry to be a nag, how would I do something like this?

you will need to make an in game editor, so you can draw the rooms back, and record the tile positions.


I understand the tilemaps and I have a tileset already made. But I have no idea how to make an 'in game editor'.

Thanks for your help man I really appreciate it, giving me a direct answer on the best approach is brilliant :D
B
9
S
3
Posts: 45
Reputation: 770

Post » Mon Oct 12, 2015 11:01 pm

Actually, you can grab the JSON data in an easier way....

Draw the tile maps out in Construct 2 for the room.

Then use an System.OnStart--------------browser.Download:Tiles as Json

I am in a good mood, here is a template to learn from:

https://mega.nz/#!sZBHHY5J


Could just make 7 text objects, and copy and paste those strings into their text field. Then when it comes time to load a tile set you have it randomly pick one of the text objects to load the json string from.

i highly recoomend learning and using arrays though.

Have fun!
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 13, 2015 12:32 am

@jojoe,

I got your PM but unfortunately can't reply (need 500 rep). I am very interested though but have a few questions for you I can't post my email in the this thread but if you look on my profile I have my Steam ID on there if you want to add me can talk through Steam.

Thanks man!
B
9
S
3
Posts: 45
Reputation: 770

Post » Tue Oct 13, 2015 11:27 am

@jojoe - if you are still in a good mood, please make the decryption key available ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Tue Oct 13, 2015 2:50 pm

Wow! it encrypts the keys? It was not like this yesterday, sorry about that:

https://mega.nz/#!sZBHHY5J!8awDC7v6Dd0T ... NcZA8Z8y04
B
29
S
8
G
4
Posts: 767
Reputation: 5,985

Post » Tue Oct 13, 2015 4:40 pm

Thank you.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Previous

Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 7 guests