Introducing Lime - A module to import 2D tilemaps in your game.

Graham:
The code for adding the object into the group’s layer works :slight_smile:

I filled the questionnaire but I forgot to add 1 more thing, sample usage as part of the quickstart guide for both orthogonal and isometric. [import]uid: 11334 topic_id: 3598 reply_id: 13051[/import]

Yay, glad it works!

Thanks for answering the questions, very helpful. I am currently creating the website for it which will have an API listing as well as written tutorials as well as hopefully video tutorials.

I also hope to include the compressed map formats as I think that will help save a lot of space. [import]uid: 5833 topic_id: 3598 reply_id: 13052[/import]

Hi Graham.

Do you currently have tile based collision implemented in this also?

Thanks [import]uid: 6981 topic_id: 3598 reply_id: 13064[/import]

In the currently released version there is no collision but in the private version that I am working on now, will be going into Beta soon, has physics implemented. Currently you can add physics in two ways:

  1. By creating an Object in an object layer with a width and height you can essentially draw physics objects, you can then apply properties such as bodyType, friction etc. This is useful for large bounding boxes say for platforms in a Platformer.

  2. By adding properties to a Tile in a Tileset (HasBody, bodyType, friction, density etc) any of those tiles in the map will automatically be set up as a physical object.

Currently actual collision events aren’t handled, but you would do that in the normal way by just setting those yourself in your code. I hope to simplify collision events later.

There is no pixel based collision or non-physics based collision in there yet, I hope to add them in at somepoint as well. [import]uid: 5833 topic_id: 3598 reply_id: 13066[/import]

I am having trouble with isometric + the ordering, it seems for the isometric to make sense I have to implement the z-ordering function during the enterframe event, but after doing so, it has slowed the whole game considerably. How do I implement sorting so that my bullets etc are z-indexed properly?
I know this is not related to Bounty directly but I am sure any noob programmer who is trying to do isometric would find the suggestion useful. [import]uid: 11334 topic_id: 3598 reply_id: 13093[/import]

Could you post up the code that you have so I can have a look at it? [import]uid: 5833 topic_id: 3598 reply_id: 13233[/import]

Graham i have posted up another example of 8-way tile scrolling using reusable sprites. ie there is an extra row and a column of tiles outside of the screen area, which scrolls on for the width/height of the tile and then resets the whole group back to (0,0) and changes the tile sprite frames

http://developer.anscamobile.com/forum/2010/12/09/8-way-tile-scroller-reused-sprites

I don’t really know how this can be used with physics (it might be good if ansca could allow to separate physics from actual display objects and then just allow the user to sync the physical definition and the display separately). I’m guessing if you’re going to be using Bounty with a large display group/world (ie not using this recycling method above then you will need to do a lot of culling, disabling physics on offscreen items etc?)
I do think the sprite recycling method would still be useful to have it as one of the scrolling options for Bounty, although obviously a different collision approach may be needed.

anyway thought I’d share for you or anyone to pick apart/clean up/optimize etc! I won’t be working on it for a while… I’m hoping someone can make a more useful module out of it at some point

regards
j
[import]uid: 10744 topic_id: 3598 reply_id: 13451[/import]

(posted under wrong account! it’s me by the way) [import]uid: 6645 topic_id: 3598 reply_id: 13453[/import]

@Graham
I ended up creating another layer to contain all the game that’s happening, before I put the game objects at the same layer as the tiles and I ended up having to sort that group, including the tiles and that has slowed the whole game considerably.

Now I have 1 group called “game_layer” with content such as bullets, towers, enemies etc that I can sort the layering so the placement makes sense. Basically during enter frame I would sort the objects in that game_layer based on Y coordinate, the higher the Y would mean it’s more to the “front” in terms of z-index, it would be the higher layer. So far it has worked, taking ideas from this link:http://www.packtpub.com/article/ordering-buildings-flash-virtual-worlds [import]uid: 11334 topic_id: 3598 reply_id: 13457[/import]

@brasstech/jmp909

Thanks for the code, I will look at it tomorrow. Although I do like the idea of reusable tiles like you have implemented I think it might end up being a whole lot of work, as you suspect, with culling and physics objects etc.

Either way I will look into it though as it would be a nice option.

@newbie101

Sounds like you have it working quite nicely, if you have any other questions please ask away.

I hope to be putting more work into Isometric maps soon as they would be a really cool addition to Bounty.

@everyone else

I will be opening up my website tomorrow which will eventually be where the new release is bought from, I have decided to rename the whole package back to Lime (rather than Bounty) as it just makes more sense.

The site will include tutorials and a complete API listing as well as details on Limes features so that you can have a look over things before I finally release it publicly for all to buy. [import]uid: 5833 topic_id: 3598 reply_id: 13459[/import]

actually i meant culling with regards to the alternative method you use currently with just creating a big display group for the map. does some of this happen automatically with Box2D? i read something about a broadphase that ignore distant objects, although i might be wrong. also i was guessing you’d need to do local visibility tests on objects around the current screen (within a certain distance). I’ve been looking at spatial indexing for this so you’re only doing visibilty tests on items a few grid spaces away from the current screen (otherwise you’re looping over/testing objects you don’t even need to be looking at… ie 3 screens or more away etc)

Have you done much investigation into the scrolling yet? (performance vs many objects vs world size etc?)

j [import]uid: 6645 topic_id: 3598 reply_id: 13461[/import]

I haven’t done as much testing/investigating as I would like (or plan to) simply as I don’t have access to any devices any more, hopefully I will get mine back very soon. [import]uid: 5833 topic_id: 3598 reply_id: 13465[/import]

Ah, I didn’t add the target stuff as I don’t do that on my sites. Didn’t realise it was needed on the forums, will add that now. Thank you :slight_smile: [import]uid: 5833 topic_id: 3598 reply_id: 13500[/import]

I have just launched the site! JustAddLime

Currently there are 7 tutorials up (with actual sample code to download temporarily removed) as well as the API listing, this will give people an idea of what is to come and how you would go about setting up your worlds.

As it says on the site, when it goes on sale it will be priced at $19.95 going up to $29.95 at a later date that is to be decided. Hopefully this will be a good price.

Please have a look around the site and tell me if you see anything wrong with it, the blog system is very basic right now but I hope to add more soon like comments and tags etc.

Hope you like it. [import]uid: 5833 topic_id: 3598 reply_id: 13497[/import]

great stuff graham! JustAddLime

[JustAddLime](http://www.justaddli.me) [import]uid: 6645 topic_id: 3598 reply_id: 13499[/import]

it isn’t. i just took it out above and it’s fine [import]uid: 6645 topic_id: 3598 reply_id: 13501[/import]

Weird, no idea how I messed up the original then :slight_smile: Probably a missing quote or something stupid like that. [import]uid: 5833 topic_id: 3598 reply_id: 13502[/import]

Is there a demo version? From what I’ve seen of time map support in Corona particularly on Android I would have to see if working before I bought! [import]uid: 9371 topic_id: 3598 reply_id: 13506[/import]

I’m trying to work out if I could do some kind of trial version, maybe just have the visual part included and not the physics?, but either way I will have videos up showing it in use and I also plan to make a demo app/game myself with it that I can put on the app store for everyone to try out.

It will be very simple just showing off some of the various types of maps etc. [import]uid: 5833 topic_id: 3598 reply_id: 13508[/import]

I still would like support for reading maps in txt files. Like

01020440
02004040
04030400

etc [import]uid: 9371 topic_id: 3598 reply_id: 13509[/import]