Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  TILES.  (Read 640 times)
0 Members and 1 Guest are viewing this topic.
Offline Delinitor

Senior Newbie

« Posted 2012-07-31 21:16:37 »

I'd really love to make a 2d top-down tile-based game, similar to Legends of Yore ( in that you move one square at a time. Unfortunately, I have no idea where to start  Clueless

I've made a few really basic things using Slick2D, but when I've tried to Google where to start with tile-based games, I've not been able to find anything D: So, what I'm asking is, could you help me out with starting to program a tile-based game?

Offline jdgamedev

Senior Newbie

Medals: 1

Chillin Like a Villin

« Reply #1 - Posted 2012-07-31 21:26:24 »

I would start by figuring out what you want this game to be. Write out some basic goals before jumping in.

After you've got a good idea of what you want it to look like, pick a direction. Separate the game into much smaller tasks and pick one to tackle.

I'm actually working on a top-down tile-based RPG right now and I chose to create the world and a player just so that I could start moving around and testing collision, etc. A couple hours after I started I've got a dude running around multiple levels. Using placeholders for your art will speed up the process quite a bit.

For my maps, I'm just using basic arrays to hold integers. Each one represents a different type of tile to draw to the screen. Also, when you move off the screen to the next area, the map get's loaded as the current level and redrawn.

Right now my game is super simple and easy to get up and running. You can check out the source on my github page and I wrote about the steps I took to get the map up and running on my blog.

TL;DR - Break your ideas down into small bite-sized chunks and pick a direction to go in. You can find more help online for small topics rather than a very large topic like tile-based games.

Now go out there and make another awesome RPG. The world doesn't have nearly enough of them!

I'm on a quest to become a better game developer, check it out.
Offline Delinitor

Senior Newbie

« Reply #2 - Posted 2012-08-01 01:29:40 »

Thanks that was some great advice! I've designed the basic idea of the game now. My current task is drawing tiles on the screen. Which is proving to be troublesome :/

So I took a look at the source of your game, and at your blog, and found both to be really helpful. But, I've come across a problem ... How do you draw the array on-screen? In your source, you've used:

Which doesn't seem to work for me  Sad I've made the arrays, and I've assigned the numbers to Images, but that bit doesn't seem to work and I don't know what else to use.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #3 - Posted 2012-08-01 02:51:13 »

What's your problem? Moving exactly one tile like Yore? just simply add the x or y with tile's size each key press.

And about that array, it's array of object which has method draw() taking 'g' as parameter (which I believe is Graphics).

Offline jdgamedev

Senior Newbie

Medals: 1

Chillin Like a Villin

« Reply #4 - Posted 2012-08-01 03:03:13 »

The problem you are having could be a wide variety of issues. Without seeing your code it is very difficult to figure out what's going on. Instead, I'll try to explain what my game is doing to draw the tiles.

For rendering the world to the screen I have 4 classes: World, Level, Tile, and Map.

The Map class simple holds an array for each level. It's basically just the layout.

The Tile class represents a single tile, so mostly it just loads the right image. It also has its own draw method.

The Level class organizes the tiles based on the appropriate map and has it's own draw method, which simply calls draw on each tile in the level.

Finally, the World class keeps all the levels organized and calls the proper level's draw method when needed.

The code that you pasted here is the World class retrieving the appropriate level from the levels array, and calling that level's draw method. That method then just calls the draw method of each tile in that level.

I hope that I explained it well enough to help you figure out the bug you've got going on. If you want more in depth help, feel free to give us your code so we can look over it.

P.S. Glad I could help get you on the right track!

I'm on a quest to become a better game developer, check it out.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Riven (24 views)
2015-07-27 16:38:00

Riven (14 views)
2015-07-27 15:35:20

Riven (19 views)
2015-07-27 12:26:13

Riven (9 views)
2015-07-27 12:23:39

BurntPizza (24 views)
2015-07-25 00:14:37

BurntPizza (36 views)
2015-07-24 22:06:39

BurntPizza (20 views)
2015-07-24 06:06:53

NoxInc (23 views)
2015-07-22 22:16:53

NoxInc (15 views)
2015-07-22 22:13:39

Jesse (36 views)
2015-07-22 03:10:36
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!