Million Tile Engine Beta Release

That makes sense.

Thanks dyson!

Hi, I just purchased this library. Is it possible to scroll around the map on touch and to do pinch zoom? I want to zoom in slighty on my map and be able to scroll around with my finger and zoom in / out

Sure, you could easily accomplish all of that using a couple multitouch events and MTE’s moveCamera() and zoom() functions. I don’t have any pinch-to-zoom code examples on hand, but I talk about how to implement touch-based scrolling in this post: http://forums.coronalabs.com/topic/33119-million-tile-engine-beta-release/?p=176172

Just letting you know that the last update fixed our flip+rotate issue.

Thanks!

Good to hear, AlanPlantPot!

To those of you interested in pinch zoom and touch scroll, I’ve modified the main.lua of CastleDemo to demonstrate one way to accomplish these behaviors. To try it out rename or delete main.lua from the CastleDemo 0v821 project folder and replace it with this new file: https://docs.google.com/file/d/0B8zoywKO40aibnpuVDQ0RjRsbDA/edit?usp=sharing

The implementation is a slightly modified version of the Corona sample code available here: http://developer.coronalabs.com/content/pinch-zoom-gesture

1 Like

How does removeSprite work? I get an error mte.lua:754: attempt to index field ‘?’ (a nil value). Obviously doing something wrong and I cant find an example of this

 local setup = { kind = "sprite", layer = mte.getSpriteLayer(1), locX = pos1, locY = pos2 - 1, levelWidth = 24, levelHeight = 24 } tower1sprite = mte.addSprite(tower1, setup) mte:removeSprite(tower1sprite)

The correct syntax uses a period, not a colon, between mte and removeSprite(). 

“mte:removeSprite(tower1sprite)” should be “mte.removeSprite(tower1sprite)”

I have a requirement to be able to stop a moving sprite after having called moveSpriteTo().

I looked at Update() and it has the below snippet of code:

local spritesFrozen = false local cameraFrozen = false local tileAnimsFrozen = false local update = function()     for i = 1, #map.layers, 1 do         isMoving[i] = false     end          if not spriteFrozen then  

Notice that the variables are spritesFrozen (with an S ) and spriteFrozen (no S). I can set spriteFrozen and that stops all sprites from moving, but I really just want to stop one so I did this:

https://gist.github.com/devildog/5793166

local cancelSpriteMoveEx = function(sprite) --spriteFrozen=true if movingSprites[objects[sprite]] == objects[sprite] then local s = movingSprites[objects[sprite]] s.isMoving=false s.deltaX = nil s.deltaY = nil movingSprites[objects[sprite]] = nil end end M.cancelSpriteMove = cancelSpriteMoveEx  

Which seems to work and so far hasn’t caused any issues.

Nicely done! If you don’t mind I will include this in the next release of MTE so everyone can take advantage. 

With the start of this week I continue to work on iso projection and iso maps. I’ll keep everyone posted.

Yes, feel free to include / modify / etc.

Work on the new features is done and I’ve moved on to testing all the changes.

Flips and rotation in Tiled go a long way to simplifying map creation and reducing tileset sizes. For example, why have four tiles for four corners when you can just rotate one single corner tile as needed? Camera constraints are working quite well too. With a single line of code you can lock the camera to an area on the map and move the camera into it with transition easing functionality. You can specify what boundaries the camera should obey; left, top, right, and bottom in any combination.

Progress is on track for a Friday release.

Still looking at a release tomorrow.

This update will include a spiffy new sample project demonstrating rotated tiles, screen constraints, and storyboard integration. The sample is composed of three seperate maps, each of which is broken up into rooms by screen constraints and connected to each other by stair tiles (triggered by Tiled objects).

All three maps were made with just 5 tiles. MTE layer lighting is used to subtly change the color of each map.

[media]http://www.youtube.com/watch?v=MoO8-CtC1TE[/media]

This looks amazing. I read all 4 pages of this thread and I was ready to buy around the middle of 2nd page… It keeps getting better and better. Now if only I could get gumroad accept my PayPal… Am I the only one fussy about giving my credit card to yet another storefront??? Any options to buy with PayPal? Thanks

Looking good. I think this is really going to help us out a lot.

MTE v0.820 - http://gum.co/staO

 

Another three weeks, another new update! MTE 0.8 focused on platforming and sidescrolling mechanics. MTE 0.820 returns to it’s RPG roots, bringing a number of useful new features:

 

Camera Constraints: define areas within which the camera and view must remain. Subdivide maps into distinct areas, break up rooms inside of a building, or just lock the camera to the map. This new feature will add new flexibility to RPG projects.

 

Tile Flip and Rotation: the Tiled map editor allows you to flip and rotate tiles before placing them in the map, and MTE now supports this functionality! It is no longer necessary to duplicate the same tile image facing four different directions in your tilesets. Just use one and rotate as needed!

 

A New Sample Project: RotateConstrainStoryboard. The sample lives up to its namesake by demonstrating tile rotation, camera constraints, and storyboard integration all in the same project. Tile rotation allowed for the use of an incredibly tiny tileset: just 2 x 3 tiles, only 5 of which were used! I’ve set up camera constraints to create the impression of distinct rooms inside of a building. The camera locks to one room at a time before moving to the next when the player hits a Tiled Object trigger. Storyboard integration takes the hassle out of switching from one map to another and another.

 

With this update out of the way I’ll be moving on to one of the two huge new features coming to the Million Tile Engine: Isometric maps. I expect this feature to take between one and two months to implement, at which point MTE will reach version 0.9 and I’ll move on to the final major update in the pipeline: physics integration.

 

http://gum.co/staO

Congratulations on the new version. Can’t wait to get my hands on your amazing work. Thanks much for all your efforts.

EDIT: This post contains experimental features which are not a part of MTE.

[media]http://www.youtube.com/watch?v=WaickzD6tj4[/media]

Experimental MTE functionality.

EDIT: This post contains experimental features which are not a part of MTE.

I’ll be spending this week experimenting to see just how far I might be able to push isometric projection. That and starting to lay the groundwork for more traditional iso maps.

[media]http://www.youtube.com/watch?v=pvxRKojf3Ww[/media]

I’m dizzy!  :slight_smile:  That was amazing!!! Great work. 

I’ve said it once before - but WHOA! Dyson you are a genius!