Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
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 568 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 (http://www.legendsofyore.com/) 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?

Thanks!
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:
1  
levels[currentLevel].draw(g);

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.

Thanks!
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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (51 views)
2014-11-26 15:22:04

toopeicgaming1999 (43 views)
2014-11-26 15:20:36

toopeicgaming1999 (8 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (25 views)
2014-11-25 11:26:43

Gibbo3771 (23 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (75 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!