Handling many (200+) static objects.

Discuss game development design and post your game ideas

Post » Wed Oct 12, 2016 4:27 am

alextro wrote:I use "proxy object" in my example to call big images when it will about to appear on screen. You won't notice what's happening till using debug mode.

https://dl.dropboxusercontent.com/u/659 ... latfo.capx


Nice! Looks like we're basically doing the same thing I just store the locations in an array instead of a proxy object.
B
18
S
8
G
4
Posts: 88
Reputation: 3,124

Post » Wed Oct 12, 2016 4:30 am

kossglobal wrote:
roguecore wrote:
nemezes wrote:in this small tutorial game that I made, all the solids is one tilemap (just one object), then I "cover" it with another tilemap. so, with 2 objects, I get all the static solids of the game. you can download the source code of the game and see how I made it. ;)

https://www.scirra.com/arcade/tutorial- ... game-10855


Not bad! I like the music and visual style. What happens if you want to remove a brick? Can you edit the tilemap during runtime? When the brick shows cracks are you just spawning a sprite on top of the tilemap?


Yes, you can destroy it. You need to do a few things before anything:
1- Solid tilemap and the respective Tilemap with all the graphics must have the same size.
2- The same for the array. (e.g an array with 50 width and 20 height correspond to a tilemap of 1600 by 640 if tiles measure 32px (50*32 = 1600 and 32*20 = 640)
3- once done it all your map will be manageable because you now can use your array since every cell of the array correspond to a tile on the screen.
4-If you want to destroy some foliage on the map with your bullet... on destroy get the bullet's position, convert the x and y coordinate into tiles and now you know which tile to destroy.

Let me know if an example in capx is needed.


Good advice! I think I will use this technique in my game :)
B
18
S
8
G
4
Posts: 88
Reputation: 3,124

Post » Wed Oct 12, 2016 9:38 am

roguecore wrote:
alextro wrote:I use "proxy object" in my example to call big images when it will about to appear on screen. You won't notice what's happening till using debug mode.

https://dl.dropboxusercontent.com/u/659 ... latfo.capx


Nice! Looks like we're basically doing the same thing I just store the locations in an array instead of a proxy object.


Once proxy object out from screen, the image will removed. And once it enter the screen, the image will restored. Probably easy enough for people who don't want mess with an array object.
ImageImage
B
108
S
49
G
23
Posts: 783
Reputation: 22,611

Previous

Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 1 guest