Well technically you could easily create your own assets for my engine if you know the proper way. I plan on having other editors for creating other assets like tiles.
Each grid square is a tile. A tile can be static or animated using a set of frame quads. And it's defined from .lua file. Each tile has an update callback which is called once per frame and is global to all tiles of that type. And a draw callback which draws everywhere the tile exists in the grid. Tiles can also be set to different layers. i.e. sort order.
For instance, this is what the Ice tile looks like:
Code: Select all
local tile = {
name = "Ice",
kind = "tile",
quads = {imageLibrary.iceQuad[1], imageLibrary.iceQuad[2], imageLibrary.iceQuad[3], imageLibrary.iceQuad[4], imageLibrary.iceQuad[5], imageLibrary.iceQuad[6], imageLibrary.iceQuad[7], imageLibrary.iceQuad[8], imageLibrary.iceQuad[9], imageLibrary.iceQuad[10], imageLibrary.iceQuad[11]},
variations = 1,
id = 6
}
function tile:update(dt)
self.frame = math.floor(((gameLevel.camera[0].x + gameLevel.camera[0].y) / 8) % #self.quads) + 1
end
function tile:draw(drawPool, pool, x, y, var, layer)
drawPool:push {
pool = pool or 0, image = imageLibrary.iceImage, quad = self.quads[self.frame or 1], color = {255,255,255},
x = x, y = y, layer = layer,
rot = 0, sx = 1, sy = 1, iox = 0, ioy = 0, kind = "image"
}
end
return tile
It has definition statistics. Variations means how many different versions there might be. For instance a dirt wall tile might have a handful of slight different versions to choose from. In this case there's only the one ice tile. ID is the map grid ID this tile will use by default in the editor. In this case, 6 is Ice. So when you place this tile, it will set the collision mask automatically to ice. And Quads is a list of quads to localize to this one tile. It gets used in the draw callback as shortcuts. In this case, the tiles frame is calculated in update (Remember this will be global to the map and only called once so all tiles share the one update. In this case it will wrap between 1 and 11.) by looking at the camera position and offsetting the frame so it looks like the ice shimmers. Then in draw it simply uses the quad with that frame value.
When a map is loaded the game checks to see which tiles have update callbacks and adds them to a list which it runs through once per frame. This means the tile will share the update code. If you need to make each tile of that type have a different appearance, you can do that in draw which will be called for every instance rather than once.
Maps are created in layers. There's two (currently) background parallaxing layers. The normal layer which is made from 4 separate sub layers. (Background, two center and a front detail layer. The player and characters would exist between the front middle layer and the frontmost detail layer.) And a foreground parallaxing layer (Which I don't use yet but am imagining can also be parallax and would work like the front layer in Yoshi's Island in the first level with the orange flowers.) My editor currently only allows editing of the normal layer. I will implement a parallax editor eventually.
I don't have a story or anything of course. I never do. I'm not good with the front end aspects of most game design. I could never really come up with a good story. But would probably just throw together something generic and sprinkle in other aspects and plot twists. My real problem would be creating sprites. I can easily make tiles, but drawing enemies and the player and other characters is near impossible for me. I've never really had that ability. I figure if I can create an engine and story I can find someone willing to do the sprite work once stuff is in place. You can't make the sprites until you know how big they need to be and what actions you'll need.
I don't know how useful a level editor would be for a game like this but it'd be included anyway. I would figure something out. Maybe make a way for people to create a whole new game if they wanted to. Map editors for the overworld and action stages. Entity editor. Sprite editor. Tile editor. Script editor. Really I'll just set it up so you can choose a separate resource folder to load from. There could be downloadable adventures and simple stamina endurance tests. I dunno. The ideas are all here. I just need to not be lazy and implement them. Or not get bored and want to do something else.
And I use a drawPool which means I add images and shapes to a pool then sort them by layer and then draw them to the screen. Every tile and entity can push as many objects to the drawPool. And technically anything can have its own drawPool if it needs to.