Sign in to follow this  
QuackTheDuck

XNA - Tile Engine With Collision

Recommended Posts

i've been trying for a while now, but i'm not sure on how to make a tile engine that reads from an array, and for example if i put a '#', how do i make it solid? I've been thinking about something like this:

Reads from array: case '#': { new Solid(//some variables); }

So when the code runs through the Array and hits an '#', it creates, well, maybe a brick thats solid which you can stand on and stuff :)

Also, is it possible to maybe fix the background in the program Tiled, and then only run through an array with events or collision?

Any ideas, im thinking about a Mario stylish game :)

Thanks in advance ;3

 

Share this post


Link to post
Share on other sites

Hi :)

 

Here you can download codesamples for reading a map from a textfile.

http://xnafan.net/2013/01/2d-map-generation-for-xna/

 

This code uses numeric values, but you can change what you do with the characters read to a SWITCH statement like you are mentioning in your question.

 

Kind regards - Jakob

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this