9 Replies - 12601 Views - Last Post: 30 June 2010 - 07:46 AM

#1 Hellbroth  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 190
  • Joined: 15-August 09

XNA Tile Collision Detection

Posted 11 April 2010 - 11:25 PM

Ok here is my code it just prints a character and a tile map on the screen and there is no camera
so only my character is moving.

I created a bool named passable and my thought was if it's a passable tile enable the user to
use the buttons to move if not then he can't.

I tried my different things i spend like a whole knight reading forums etc but i just can't find
a simple tutorial on how to do this seriusly this is getting hilarius it can't be that hard
and it's the only thing i am realy missing to start doing some serius staff for 2d tile games.

I even opened the Platform package but still no luck there too.
Everyone is doing it in a different way and no one is explaining how to do a simple thing.

So i am realy asking desperate for some help here or otherwise i will loose my mind with this thing.

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace WindowsGame41
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        List<Texture2D> tiles = new List<Texture2D>();


        static int tileWidth = 16;
        static int tileHeight = 16;

        int[,] map = {
                           {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                          {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            };

        Texture2D character;
        Vector2 characterPosition = new Vector2(155, 50);
        Point frameSize = new Point(28, 32);
        Point currentFrame = new Point(0, 0);
        Point sheetSize = new Point(4, 3);
        float speed = 4;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 100);
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            tiles.Add(Content.Load<Texture2D>("wood"));
            tiles.Add(Content.Load<Texture2D>("grassy"));
            character = Content.Load<Texture2D>("trainer2");
        }

        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            KeyboardState currentState = Keyboard.GetState();




            bool passable = true;

            if (passable == true)
            {

                if (currentState.IsKeyDown(Keys.Up))
                {
                    currentFrame.X = 3;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.Y -= speed;
                }


                else if (currentState.IsKeyDown(Keys.Down))
                {
                    currentFrame.X = 0;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.Y += speed;
                }

                else if (currentState.IsKeyDown(Keys.Left))
                {
                    currentFrame.X = 2;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.X -= speed;
                }


                else if (currentState.IsKeyDown(Keys.Right))
                {
                    currentFrame.X = 1;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.X += speed;
                }

            }

                int tileX = (int)characterPosition.X / tileWidth;
                int tileY = (int)characterPosition.Y / tileHeight;

                if (map[tileY, tileX] == 0)
                {
                    passable = false;
                }



            base.Update(gameTime);
        }

       

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            for (int y = 0; y < map.GetLength(0); y++)
            {
                for (int x = 0; x < map.GetLength(1); x++)
                {
                    spriteBatch.Draw(tiles[map[y, x]], new Rectangle(x * tileWidth,
                y * tileHeight, tileWidth, tileHeight), Color.White);

                }
            }
            spriteBatch.Draw(character, characterPosition, new Rectangle(frameSize.X * currentFrame.X,
                frameSize.Y * currentFrame.Y,
                frameSize.X,
                frameSize.Y),
                Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
            spriteBatch.End();

            base.Draw(gameTime);
        }
    }
}


This post has been edited by Hellbroth: 11 April 2010 - 11:25 PM


Is This A Good Question/Topic? 1
  • +

Replies To: XNA Tile Collision Detection

#2 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: XNA Tile Collision Detection

Posted 12 April 2010 - 10:26 AM

Your problem is that you are adding speed to the player's position before checking to see if the player can move into the next tile. The best way to do this is to have a Vector2 that holds which direction the player wants to try to move. You will then check to see if the player can move into the next tile. If the player can't move into the next tile you can set the values of the Vector2 to 0 to cancel the movement. After for checking for the tile collision you add the Vector2 to the player's position.

Finding what tile the player will move into is a little problematic and is different from case to case. The cases you need to handle are:
  • Up and Left
  • Up
  • Up and Right
  • Left
  • Right
  • Down and Left
  • Down
  • Down and Right


If you are restricting the character to just moving Up, Left, Right, and Down, this becomes a little easier. Right now don't have the code I use for tile/sprite collisions. When I'm home I will give you a better example.
Was This Post Helpful? 0
  • +
  • -

#3 Hellbroth  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 190
  • Joined: 15-August 09

Re: XNA Tile Collision Detection

Posted 13 April 2010 - 10:16 AM

I am realy thankfull i will wait for your help.
God this thing has haunted my dreams i even watch it in my sleep.
Was This Post Helpful? 0
  • +
  • -

#4 Hellbroth  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 190
  • Joined: 15-August 09

Re: XNA Tile Collision Detection

Posted 13 April 2010 - 04:14 PM

Ok Somethings i have to make clear.

characters width = 28
characters height = 32

tile width = 16
tile height = 16

int tileX = (int)(characterPosition.X) / tileWidth; //used to give the position at the X coordinate
int tileY = (int)(characterPosition.Y) / tileHeight; //used to give the position at the Y coordinate



I was told by you that by using this :

map[tileY, tileX] = 0;



it should chages the tile my character is on but what it does is it changes the tile that's next to him
on the left side and above him.

but if i change the two lines that give the position into that :
int tileX = (int)(characterPosition.X+10) / tileWidth;
int tileY = (int)(characterPosition.Y+22) / tileHeight;



it draws exactly the tile under the characters feet :)

so i used this to change the only one tile that's a wood tile to change it
into grass when the character passes on it.

if (map[tileY, tileX] == 0)
{
map[tileY, tileX] = 1;
}

So that's something i think.


Hope this is usefull information.

This post has been edited by Hellbroth: 13 April 2010 - 04:22 PM

Was This Post Helpful? 0
  • +
  • -

#5 Hellbroth  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 190
  • Joined: 15-August 09

Re: XNA Tile Collision Detection

Posted 15 April 2010 - 01:17 AM

At last i am almost there he is my progress.

int spriteWidth = 16;
                int spriteHeight = 16;


                int tileX = (int)(characterPosition.X + 10) / tileWidth;
                int tileY = (int)(characterPosition.Y + 22) / tileHeight;
                int left = (int)Math.Round(characterPosition.X / tileWidth);
                int top = (int)Math.Round(characterPosition.Y / tileHeight);
                int right = (int)Math.Round((characterPosition.X + spriteWidth) / tileWidth);
                int bottom = (int)Math.Round((characterPosition.Y + spriteHeight) / tileHeight);

                 if (map[top, left] == 2)
                {
                    characterPosition.Y += speed;
                }
                else if (map[top, tileX] == 2)
                {
                    characterPosition.Y += speed;
                }
                else if (map[top, right] == 2)
                {
                    characterPosition.Y += speed;
                }
                else if(map[tileY,left] == 2)
                {
                    characterPosition.X += speed;
                }
                else if (map[tileY, right] == 2)
                {
                    characterPosition.X -= speed;
                }




Ok till here the character can't pass topLeft,top,topRight,left,right.
But i can't do the downLeft,down,downRight.

i tried this but still nothing.

else if(map[bottom,left] ==2)
{
characterPosition.Y -= speed;
}
else if(map[bottom,tileX] ==2)
{
characterPosition.Y -= speed;
}
else if(map[bottom,right] ==2)
{
characterPosition.Y -= speed;
}



So anymore suggestions with this?

This post has been edited by Hellbroth: 15 April 2010 - 02:36 AM

Was This Post Helpful? 0
  • +
  • -

#6 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

Re: XNA Tile Collision Detection

Posted 22 April 2010 - 03:36 PM

You are using a lot of magic numbers here. It is hard to know where your values are coming from.

For example why are you adding 10 and 22 to characterPosition.X and characterPosition.Y? The tileX and tileY should be the upper left corner of the sprite.
Was This Post Helpful? 0
  • +
  • -

#7 Hellbroth  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 190
  • Joined: 15-August 09

Re: XNA Tile Collision Detection

Posted 23 April 2010 - 12:04 PM

View PostSixOfEleven, on 22 April 2010 - 02:36 PM, said:

You are using a lot of magic numbers here. It is hard to know where your values are coming from.

For example why are you adding 10 and 22 to characterPosition.X and characterPosition.Y? The tileX and tileY should be the upper left corner of the sprite.


:S i thought it had to be the tile below the character :/ my collision is working now but i am using magic numbers like you said.I know it's not accurate but it looks fine when you watch it.
Was This Post Helpful? 0
  • +
  • -

#8 nineball_ssj9  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-October 07

Re: XNA Tile Collision Detection

Posted 30 June 2010 - 04:37 AM

This is exactly what i was looking for . I been looking for this type of tilemap all day. This is very helpful and whoever you are...you are the best coder i'm loving it!!!!!
Was This Post Helpful? 0
  • +
  • -

#9 nineball_ssj9  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 03-October 07

Re: XNA Tile Collision Detection

Posted 30 June 2010 - 07:37 AM

View PostHellbroth, on 11 April 2010 - 10:25 PM, said:

Ok here is my code it just prints a character and a tile map on the screen and there is no camera
so only my character is moving.

I created a bool named passable and my thought was if it's a passable tile enable the user to
use the buttons to move if not then he can't.

I tried my different things i spend like a whole knight reading forums etc but i just can't find
a simple tutorial on how to do this seriusly this is getting hilarius it can't be that hard
and it's the only thing i am realy missing to start doing some serius staff for 2d tile games.

I even opened the Platform package but still no luck there too.
Everyone is doing it in a different way and no one is explaining how to do a simple thing.

So i am realy asking desperate for some help here or otherwise i will loose my mind with this thing.

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace WindowsGame41
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        List<Texture2D> tiles = new List<Texture2D>();


        static int tileWidth = 16;
        static int tileHeight = 16;

        int[,] map = {
                           {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                          {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, },
                            };

        Texture2D character;
        Vector2 characterPosition = new Vector2(155, 50);
        Point frameSize = new Point(28, 32);
        Point currentFrame = new Point(0, 0);
        Point sheetSize = new Point(4, 3);
        float speed = 4;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 100);
        }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            tiles.Add(Content.Load<Texture2D>("wood"));
            tiles.Add(Content.Load<Texture2D>("grassy"));
            character = Content.Load<Texture2D>("trainer2");
        }

        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// </summary>
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            KeyboardState currentState = Keyboard.GetState();




            bool passable = true;

            if (passable == true)
            {

                if (currentState.IsKeyDown(Keys.Up))
                {
                    currentFrame.X = 3;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.Y -= speed;
                }


                else if (currentState.IsKeyDown(Keys.Down))
                {
                    currentFrame.X = 0;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.Y += speed;
                }

                else if (currentState.IsKeyDown(Keys.Left))
                {
                    currentFrame.X = 2;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.X -= speed;
                }


                else if (currentState.IsKeyDown(Keys.Right))
                {
                    currentFrame.X = 1;

                    currentFrame.Y++;
                    if (currentFrame.Y >= sheetSize.Y)
                        currentFrame.Y = 0;
                    characterPosition.X += speed;
                }

            }

                int tileX = (int)characterPosition.X / tileWidth;
                int tileY = (int)characterPosition.Y / tileHeight;

                if (map[tileY, tileX] == 0)
                {
                    passable = false;
                }



            base.Update(gameTime);
        }

       

        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            spriteBatch.Begin();
            for (int y = 0; y < map.GetLength(0); y++)
            {
                for (int x = 0; x < map.GetLength(1); x++)
                {
                    spriteBatch.Draw(tiles[map[y, x]], new Rectangle(x * tileWidth,
                y * tileHeight, tileWidth, tileHeight), Color.White);

                }
            }
            spriteBatch.Draw(character, characterPosition, new Rectangle(frameSize.X * currentFrame.X,
                frameSize.Y * currentFrame.Y,
                frameSize.X,
                frameSize.Y),
                Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
            spriteBatch.End();

            base.Draw(gameTime);
        }
    }
}



you know how the 0's represent the grass and the 1's represent the wood...what if i want to change the values of 1's and 2's what if i want to change the map into a 2d mario broher type map what should i do then?
Was This Post Helpful? 0
  • +
  • -

#10 Hellbroth  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 17
  • View blog
  • Posts: 190
  • Joined: 15-August 09

Re: XNA Tile Collision Detection

Posted 30 June 2010 - 07:46 AM

                                    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
                                    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                          {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
	                            };



Here is an example how it would look like.

The 0 = transparent object so it you can't see it when it draws and the
1 = the box of your platform.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1