Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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  
  Dead End...  (Read 2677 times)
0 Members and 1 Guest are viewing this topic.
Offline teckid1991

Senior Newbie





« Posted 2006-12-04 14:22:18 »

Hello all,

Im fairly new to java but have been working on a game that i've been planing out for some time now. The game is still in the development stage and i have programmed a few classes the take care of some parts of the game but i've come to a dead end and can't seem to find a way to get the graphics i would like to see.

So, so far i have a classes for these things:
  • Entity (super class for objects in the class... such as character, wall, door, enemy, etc)
  • Characters (sub-class of entity)
  • Main Panel (will hold all of the graphics and handles mouse/keyboard events)
  • Tiles (a class the holds all of the tiles...)
  • Item (sub-class of entity... will do general "item"-like things)
  • Game (class will control general game flow and logic)

Now that i've gotten these i'm not sure where to go next. I want to get the display to work but im having trouble implementing this. I was thinking about using arrays to store the maps for the tiles... I would to use 2D graphics in this rpg but im also having trouble deciding an size.

Here (in psudo-code) is what i was thinking about using:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
declare map
...
    // store the layout for the tiles in an array
    map = { [1,0,0,1,1,1,1],
                   [1,1,1,1,1,1,1],
                   ...
                }
...

displayMap(map){
for(int j=0; j<map.length; j++){
     for(int i=0; i < map[j].length; i++){
          // draw a tile at the location its correct location
          draw(map[i])
    }
}
...


so if anyone have any ideas then...
Thanks for what ever amounts of time you decide to donate to me Smiley
Offline teckid1991

Senior Newbie





« Reply #1 - Posted 2006-12-04 14:50:01 »

Here are the files i've been working on... its a zip file with the .txt ending... just change it to .zip and you can open it with winzip
Offline fletchergames

Senior Devvie





« Reply #2 - Posted 2006-12-04 21:40:36 »

The pseudocode looks fine.

Generally, the FIRST thing I do is make it so the game gets drawn on the screen.  How can you test any of that other stuff if nothing is displayed?

Im fairly new to java but have been working on a game that i've been planing out for some time now. The game is still in the development stage and i have programmed a few classes the take care of some parts of the game but i've come to a dead end and can't seem to find a way to get the graphics i would like to see.
This part makes it sound like you just need an artist to draw art for you, but the rest makes it sound like you're having a programming problem.  If you convert your pseudocode to code, it should work fine.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline teckid1991

Senior Newbie





« Reply #3 - Posted 2006-12-06 05:40:28 »

I'm not sure what to use for displaying tiles... if i have like picture that im going to use should i use the the ImageIcon class to hold them/ display or is there a better way?

currently this is what i have:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
...
private ImageIcon tile;
private final ImageIcon[] tiles = new ImageIcon[7] //currently i only have 7 pics
private final String[] tileNames = {
                                                       ...
                                                    }
public Tile(String s){
    //store the location of the Image into the array
    tiles[0] = new ImageIcon("C:...");
    ...
    if (s != null || s != "" || s != " "){
          // if name is valid...
          tile = setTile(s);
     }
}

public ImageIcon setTile(String s){
    ImageIcon t = new ImageIcon();
    for(int i = 0; i < tiles.length; i++){
        if(tileNames[i] == s){
            // if get the index of the tilename
            if(tiles[i] == null)
                return null;
            else
                 // if tile exists then store it in t so that it can be returned
                 t = tiles[i];
               }
        }
    return t;
}
Offline fletchergames

Senior Devvie





« Reply #4 - Posted 2006-12-06 18:53:18 »

I would use BufferedImage instead of ImageIcon, but ImageIcon will work.

One issue with BufferedImages is that you need to load them the "right" way so that they get hardware accelerated.  You can search the Java2D forums for more information about this - it's what everyone always asks about.

ImageIcons just store Images inside them, so the have a little extra overhead.

I would suggest buying a book, such as Killer Game Programming in Java or Developing Games in Java because they both address these sorts of issues.
Offline teckid1991

Senior Newbie





« Reply #5 - Posted 2006-12-12 13:18:07 »

Do you know were i could find the source for JRPG (i think it was called). I would like to see what he used and how he implemented a game with such graphics.
Offline fletchergames

Senior Devvie





« Reply #6 - Posted 2006-12-12 19:33:49 »

http://sourceforge.net/projects/jrpg/
Offline teckid1991

Senior Newbie





« Reply #7 - Posted 2006-12-14 13:41:06 »

Thanks for that
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #8 - Posted 2006-12-15 12:32:06 »

Take a look at this tutorial http://www.cokeandcode.com/tutorials.  It might help you out.

Offline teckid1991

Senior Newbie





« Reply #9 - Posted 2006-12-18 13:43:02 »

Thanks... btw, i downloaded jRPG to see how the gameplay and graphics were before i started looking at the code. When i click on the demon campaign it started but once it the message comes up and i press the arrow keys to scroll or the d/esc buttons to close the box it doesn't do anything. Before i get into the code and everything is there a solution to this so i don't have to go through the trouble of coding when theres already a solution out there somewhere.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline teckid1991

Senior Newbie





« Reply #10 - Posted 2006-12-20 14:13:59 »

I've looked through the stuff provided and i've did some editing to my source code but this seems a bit over me with my level of experience. When i looked through the source code for the space invaders game i went along and edited my source to meet the necessary needs. The only problem is some of the classes i haven't worked with before and it makes me feel like im just copying codes when i read and edit mine. I was wondering what sort of game do you all usually start of with when you first started making games?

Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #11 - Posted 2006-12-20 15:48:05 »

I've looked through the stuff provided and i've did some editing to my source code but this seems a bit over me with my level of experience. When i looked through the source code for the space invaders game i went along and edited my source to meet the necessary needs. The only problem is some of the classes i haven't worked with before and it makes me feel like im just copying codes when i read and edit mine. I was wondering what sort of game do you all usually start of with when you first started making games?

That's what you do.  You copy the code and try to understand some of it.  Play with each part until you understand a little at a time.  Eventually you can just look at the API and make it yourself.

Offline fletchergames

Senior Devvie





« Reply #12 - Posted 2006-12-20 18:58:58 »

When I first starting programming games in Java, I did a puzzle game that wasn't all that great.  I learned how to work with Swing and so forth by looking at code examples on the Internet.

When I finally bought a good book about game programming in Java, my ability really started to take off.  I can't stress enough how much reading lots of programming books helps out.
Offline teckid1991

Senior Newbie





« Reply #13 - Posted 2006-12-28 22:06:23 »

what book would you suggest?
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #14 - Posted 2006-12-28 23:03:48 »

http://fivedots.coe.psu.ac.th/~ad/jg/

Offline fletchergames

Senior Devvie





« Reply #15 - Posted 2006-12-29 16:24:15 »

Either KIller Game Programming in Java (as he suggested) or Developing Games in Java (not quite as good).  Or both - they cover alot of the same material, but I think reading both would be beneficial.  I would suggest something newer, but I don't know of any newer Java game programming books.

Some books you shouldn't buy: Advanced Game Programming in Java and Black Art of Game Programming in Java.  Of course, someone else might write new books with the same (or at least similar) names, in which case, new books with the same names might be good.  In general, it's good to avoid any old technology-oriented books.
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.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

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

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

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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