Page 1 of 1

Making the tiles smaller in the Microsoft Platform Starterkit

#1 coden4fun  Icon User is offline

  • if(coden4fun.NotTired){ ContinueToCode(); }
  • member icon

Reputation: 27
  • View blog
  • Posts: 696
  • Joined: 27-February 09

Posted 26 September 2009 - 06:35 PM

I wanted to make the tiles smaller in the Platform Starter kit, because my game was going to be a mix between a robot game that I had in mind and Knytt Stories. I was first having trouble with doing this, but at last found the errors that I had, and because one person wants to see how to do this I have decided to write this tutorial.

First We make the graphics smaller.

A typical platform tile

Posted Image
64x48 in pixels

My tile
Posted Image
20x20 in pixels

All I did was made a tile of my choice the size of my choice. Once I got that bit done I just named in the BlockA0 – BlockB6, so I wouldn’t have to modify the LoadTile function in the Level.cs class. After that I did the following.

Editing the Code

Changed the Backbuffer widths and heights in the Platform.cs class.
	//change the backbuffers so the map doesn't become to long to draw and out of proportion
	 private const int BackBufferWidth = 600;
	private const int BackBufferHeight = 300;



Finally I changed the Tile Width and Height to the pixels of the graphics in the Tile.cs class.

		public const int Width = 20;
		public const int Height = 20;



If you compile the following above you should get your tiles to be the same size as the following picture below.

Posted Image

I haven’t finished making all graphics 20x20 as you can see the player is still the same size, but the rest are, and that is how you change the width, and height of the tiles using the Platform starter kit without messing up your game.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1