Code Monkey home page Code Monkey logo

mbtileparser's Introduction

MBTileParser

Look Ma, a game engine! Running on UIKit! MBTileParser is a small game engine that supports loading TMX files and TexturePacker files directly into UIKit.

Screenshots & Demo:

I've uploaded a demo video to YouTube.

Here's what the game engine looks like in action:

Walking Around Some Dialog

Features:

MBTileParser can do five things right now. Load maps, load sprites, display dialog, take input via virtual controls, and retain game state.

  • Load maps: MBTileParser is actually the name of a class in the engine. You can load TMX files. Use the MBMapViewController class for this.
  • Load sprites: You can load sprites using MBSpriteView. MBMovableSpriteView supports movement too.
  • Display Dialog: Load and parse dialog trees, using MBDialogTree. (Support for end actions is now implemented.)
  • Take Input: Create custom virtual game controls, using the MBJoystick and MBControllerButton classes. You can also use the included layout.
  • Manage Games State: The latest update includes state support (in progress) which allows you to track levels, stamina, score, items, dialog, and more.

Setting it Up:

Clone into, or download, the repository. Copy the folder called MBGameEngine and import MBGameEngine.h.

You can also use cocoapods:

pod 'MBTileParser'

Technical Requirements:

MBTileParser requires the iOS 7 SDK and ARC.

Even if your project doesn't use ARC, you'll want to compile MBTileParser with ARC. Use the -fobjc-arc compiler flag for that.

Notes:

About the TMX format, Tiled, and TexturePacker: The TMX file format is used by Tiled, a tool which helps you make world maps for games by tiling images. (You can download Tiled here). The TMX format is explained in detail on the tiled GitHub repository wiki. The developer of TexturePacker, Andreas Löw, was kind enough to give me a license a while back. Thanks Andreas! You can get TexturePacker from his website.

Parting Words: Please take a moment to star this repository and pass it along to anyone who you think might enjoy it. I also encourage you to look at my other repositories. You might find something you like.

Always have fun, because game engines are fun.

License:

MBTileParser is hereby released under the following modified MIT License.

Copyright (c) 2013 Moshe Berman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), with the exception of the sample graphics and audio files, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The "non-code", graphics and audio, may not be used except to build and run the demo on your own machines.

The artwork is copyrighted by Allan Simpson. He has created it for a project we are working on. You may not use it for anything except to play with the game engine on your own machine(s). Sorry, it's not mine to let you give out.

Finally, if you make any awesome games with this, please let me know!

mbtileparser's People

Contributors

mosheberman avatar mystise avatar sneakyness avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbtileparser's Issues

There's a leak

There's a leak at 131 line of MBMapView.
CGImageRef image = CGImageCreateWithImageInRect(tilesheet.CGImage, tileRect);

Maybe should add Release line to 140
CGImageRelease(image);

The joystick should dispatch movement at regular intervals

As it is now, the joystick dispatches movement events when it is touched, or when touches move. The correct, more comfortable way to use the joystick would be to support dispatches at regular intervals. Perhaps this should be done in the gameControllerViewController instance.

Sprite seems off center

In the cocos2d engine, the sprite was manually offset. It seems that this offset causes breakage in the UIKit engine and must be fixed somehow or another. Sprites look funny now.

Should we start off on a new branch for SpriteKit or a new repo?

Should we start off on a new branch for SpriteKit or a new repo?
Maybe the code could be agnostic to what backing parts are implemented?

I mean if we could implement some sort of a protocol that SKSprite and related UIKit classes could conform to, then both UIKit and SpriteKit could be supported.

Then separate them within a cocoapods-subspec if you only need the SpriteKit version, e.g. Mac OS.

Adopt SpriteKit

I'd like to move to SpriteKit if possible. Not a terribly complicated thing to do here - I think there are only a few places that need changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.