I’ve been continuing work on my Java tile engine. It is continuing to evolve as is my Java knowledge. I’ve been moving to an object-oriented tile engine. There is now a map class that represents a tile map and a layer class that represents a layer of the map since I’m making a layered tile engine. At the moment there are two layers: the base layer that defines the ground and a second layer which is a decoration layer. In the future I will be moving to an unlimited, in theory, number of layers but one step at a time though. I also created a class that represents a tile set and a class for a camera that controls scrolling the map. I also created a couple utility classes. The first is used in drawing the tiles, a rectangle type class. The other represents a two dimensional vector. The vector class will continue to evolve as my game programming adventures continue.
Moving to use object-oriented programming in games is something I encourage others to do. Games can grow to be quiet complex and using objects makes them more manageable. There are times where you may want to break OOP though because following it strictly can hinder your development. In a strict OOP sense other objects shouldn’t know about the internal workings of other object. You interact with other objects using a well defined public interface. When I say interface I’m not talking Java interfaces, I’m talking a well defined set of methods for interacting with the object. You could use a Java interface to define these methods that way others who look at your code, or even yourself months down the line, will understand the object better.
With the tile engine shaping up it is time to consider what I want to do with it. I might look at creating a simple RPG with it, my favorite genre of course. First though I need to work out some more mechanics when it comes to programming games with Java. I’m taking the first steps on my adventure and truly enjoying it. Thanks for reading and as always the code for this adventure.
JavaTileEngine.java
GamePanel.java
TileMap.java
TileLayer.java
TileSet.java
TileRectangle.java
Camera.java
Vector2.java
Moving to use object-oriented programming in games is something I encourage others to do. Games can grow to be quiet complex and using objects makes them more manageable. There are times where you may want to break OOP though because following it strictly can hinder your development. In a strict OOP sense other objects shouldn’t know about the internal workings of other object. You interact with other objects using a well defined public interface. When I say interface I’m not talking Java interfaces, I’m talking a well defined set of methods for interacting with the object. You could use a Java interface to define these methods that way others who look at your code, or even yourself months down the line, will understand the object better.
With the tile engine shaping up it is time to consider what I want to do with it. I might look at creating a simple RPG with it, my favorite genre of course. First though I need to work out some more mechanics when it comes to programming games with Java. I’m taking the first steps on my adventure and truly enjoying it. Thanks for reading and as always the code for this adventure.
JavaTileEngine.java
Spoiler
GamePanel.java
Spoiler
TileMap.java
Spoiler
TileLayer.java
Spoiler
TileSet.java
Spoiler
TileRectangle.java
Spoiler
Camera.java
Spoiler
Vector2.java
Spoiler
1 Comments On This Entry
Page 1 of 1
Page 1 of 1
My Blog Links
Recent Entries
-
-
-
Object-Oriented Java Tile Engineon Jan 11 2012 01:15 PM
-
-
Recent Comments
Search My Blog
1 user(s) viewing
1 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
Categories
|
|



1 Comments










|