Ludum Dare 31
December 5th-8th, 2014

October Challenge 2014
Ending Soon!

ConstructionPlease excuse the site weirdness. Mike is making and fixing things. Clocks are probably wrong. Colors are place-holder.

What is Ludum Dare?
Rules / Guide

Posts Tagged ‘tilemap’

As I was looking forward to LD30 I thought I’d make a little base code to make life easier and maybe allow more exciting designs.

Here it is on GitHub

Anybody can use anything in there for any purpose, but giving Colthor credit would be nice.

Obviously, one can’t use the sprites and tiles for one’s compo game (and probably wouldn’t want to); they’re mostly in there as documentation and to demonstrate that/how the code works.

There’s an entire Unity project as an example, but the important parts are:

 

Camera Script

“Assets/CameraSizer.cs” is the camera script, and it automatically adjusts Unity’s 2D camera so sprites are 1:1 mapped with the screen (or some multiple of). If the script’s PixelsPerUnit is the same as a sprite’s, it’ll be mapped 1:1. If it’s half the sprite’s the sprite will be pixel-doubled, and so on. Textures mapped to meshes (for instance, with the tilemap) or whatnot don’t work like this, o’course, so make sure you size them appropriately.

 

Tilemap with auto-tiling

“Assets/TileMapScript.cs”
is the tilemap. The .cs contains more thorough documentation, but it creates a Squares_X by Squares_Y tile grid, with each square Square_Size units to a side. It gets the data about which tile to use from LevelData, which is just a text string (0-9, A-F are ‘open’ tiles, X indicates a wall, all other characters should be ignored). “Assets/32tiles.png” is an example of the texture required.

The script then auto-tiles the walls, selecting the correct tiles from the given texture, and then adds box colliders for the walls as children to the attached gameobject. To reduce the number of colliders it groups them to cover multiple walls where possible – first making it as many tiles wide as possible, then as many tiles high. It would be possible to use a single polygon collider with several paths, but it would also be considerably more work, sorry ;)  (And maybe not faster.)

The gameobject’s origin is the bottom left corner of the map, and LevelData is mapped in the same way as the tile texture; the first character is the top left, the second row will start – assuming no ignored characters – at Squares_X, and the bottom right will be character (Squares_X * Squares_Y – 1).

 

I’ll try to back-port any improvements or bugfixes made over the course of LD30 for future jams!

 

Motherloot tilemap working

Posted by
Saturday, April 26th, 2014 3:15 pm

So after a few outrageous gems problems with our tilemap, we finally got it to work.
But I’m afraid that the world – generator is a hard piece of work because it should and will be fully balanced.

While we are working on that, you can at least see some of our hard achieved progress.
Motherloot

JavaScript Tile Map Editor

Posted by
Friday, May 4th, 2012 8:05 am

One of the things that took me a lot of time during LD23 was level design. This is partly because I didn’t have a tile map editor that I was familiar with and it seemed like working with the CSV data was good enough.

I decided I wanted to have a more visual editor for future LDs (yes, I’m definitely doing this again!) so I made one. Of course, it’s in JavaScript since that’s what my game was made with and I’m trying to improve my JavaScript programming.

Please, give it a try and let me know what you think in the comments below. I’m currently hosting it via Dropbox, but I may provide a more permanent home if needed. Also, if there is interest, I’d be glad to put up a bitbucket repo with complete source.

It has been tested thoroughly in Chrome, and minimally in Firefox and IE9. I recommend using Chrome for now.

Here’s a simple screenshot to give you a feel for it:

 

Progress, Progress progress :D

Posted by (twitter: @solokix)
Saturday, April 21st, 2012 1:10 am

About 5 hours in and I’ve got a nice little tilemap, sprite engine. I’m thinking of a sort of tower defense survival thing where waves of enemies are out to get you! But so far so good, here is a screenshot

if you can be bothered here is a link to play the current version(Not much happens)Its an executable jar so just run it and go

http://dl.dropbox.com/u/48015021/LD23/Tiny%20worlds1.jar

hope everyone else is having as much fun as me :)

 

Screenshot Time

Posted by (twitter: @frimkron)
Saturday, April 30th, 2011 4:18 am

It’s time for a screenshot:

Not much to see, I’ve got a scrolling tilemap in place.

Next I’m going to get somethings moving around on it!

Graphics!

Posted by (twitter: @frimkron)
Sunday, December 13th, 2009 6:58 am

I’ve got my tilemap rendering with some placeholder graphics. Here’s a screenshot:

shot1

Busy busy busy…. back to coding!

Milestone!

Posted by (twitter: @frimkron)
Saturday, December 12th, 2009 5:40 pm

Well, I’ve come to the conclusion that I don’t have a clue what I’m doing when it comes to procedural generation. I should have had this done much sooner, but I’ve finally reached the stage where I have something which could be described as procedural dungeon generation.

I don’t actually have any graphics or gameplay, but I can now generate maps from a seed number. Here’s a section of map 0:


# # # # # . # # # # # . # # # # # # # # # # # # # # # #
# # . . . . . . . . . . . # # # # # # # # # # # # # # #
# # . . . . . . . . . . . # # # # # # # # # # # # # # #
# # . . . . . . . . . . . # # # # # # # # # # # # # # #
# # # . # # # . # X # # # # # # # # # # # . . . . . . X
# # # . # # # . # . # # # # # # # # # # # # # # # # # #
# # # . # # # . # . # # # # # # # # # # # # # # # # # #
# # # . # # # . # . # # # # # # # # # # # # # # # # # #
# # # . # # # . # . # # # # # # # # # # # # # # # # # #
# # # . . . . . # . # # . . . . # # # # # # # # # # # #
# # # . # # # . # . # # . . . . # # # # # # # # # # # #
# # # . # # # . . . X . . . . . . . . . . . . # # # # #
# # # . # # # . # . # # . . . . # # # # # # . . . # # #
# # # . # # # . . . . X . . . . X . . . . . . . . # # #
# # # . # # # . # # # # . . . . # # # # # # . . . # # #
# # # . # # # . # # # # . . . . # # # # # # X # # # # #
# # # . # # # . # # # # . . . . # # # # # # . # # # # #
# # # # # # # . # # # # . . . . . # # # # # . # # # # #
# # # # # # # . # # # # # # # # . # # # # # . # # # # #
. . . . . . X . . . . X # # # # X # # # # # . # # # # #
# # # # # # # # # # # # # # # # . . . . . . . X . . . .
# # # # # # # # # # # # # # # # . # # # # # . # # # # #
# . . . . . . . # # # # # # # # . # # # # # . # # # # #
# . . . . . . . # # # # # # # # . # # # # # . # # # # #

Once I’ve had some well-needed sleep I’ll get some graphics done, tilemap rendering, get a player walking around and introduce some treasures for him to find. Bah – there’s loads of time left ;)

[cache: storing page]