Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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  
  My First Java Game.  (Read 686 times)
0 Members and 1 Guest are viewing this topic.
Offline ISeeTheTruth

Senior Newbie





« Posted 2013-07-05 07:36:19 »

I have a grasp on basic knowledge of Java and wish to learn more. Alot more. Can anyone point me in a direction? Or like where should I start? I sit here and think "where do I start..." like I don't know weither or not to code the player and stuff first or what. Can someone point me to a guide or something? Atleast for me to learn more? Thanks.Smiley
Offline heisenbergman

JGO Coder


Medals: 14


L___ o_ G___ a__ P___


« Reply #1 - Posted 2013-07-05 07:48:12 »

Do you already know what type of game you plan on making? I think before you start just jumping in a coding, you should have an idea of what kind of game you want to try creating.

Offline _Scyth_

Junior Member





« Reply #2 - Posted 2013-07-05 23:21:08 »

One simple question that could mean a lot in where you want to go with programming games with Java.

Do you understand OOP?(Object Oriented Programming)

If you can then it'll make it a lot easier.

Get a game idea. That's how to start. Nothing too complex. Something simple.

Now about actually starting somewhere. You're going to need some additional hardware. A Pen and Paper. Expensive right?

Now you'll want to plan absolutely everything.
  • Player
  • Enemy
Etc

Each one of these will be a class. If they share common variables such as:
  • hp
  • strength
  • agility
So on.

Then go on and plan out and create an idea of how you'll do everything.

You'll need to know:
How the game is won?
How will the player interact with the game?
What feedback will the game give to the user? (Sound, new images, etc)

How will the player know what they have to do?

There's a hell of a lot of planning. Then you can begin programming.

Its always nice and helpful for when you come back to solve all the problems that will arise when you go through making the game.

So you might want to set up a couple of packages within your project in eclipse. These can store different types of classes.
For example:
A package for the screens
A package for the entities
Etc.

There's a lot of work involved. But when your ready to start programming, you'll want to start from the base up. Not somewhere in the middle.

Set up your screens, drawing surface and game loop. Then work on say a superclass called Entity.
Might look something similar to:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
public class Entity
{
   int hp, maxhp;
   int str, agi;
   int level;

   double x, y;

   boolean active = true;

   public void destroy()
   {
      active = false;
   }  
}


Hope this helps you in some way or another.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TrinityGamer

Senior Newbie


Medals: 2



« Reply #3 - Posted 2013-07-08 09:58:55 »

I agree with _Scyth_ for the most part, with 1 small difference.

Before you actually get to making your game, the best thing to do is to do a 'how to make a game' tutorial so you know the basics. the first chunk of pretty much every game (2d graphic based games, i mean) are pretty much the same for the most part. So watching/reading tutorials will help you learn how to set everything up before you actually get programming the stuff you want for your game.

While learning these basic things, and doing the tutorials, you should write down a basic outline of what you want in your game, then fill it out in as much detail as possible. Doing this WHILE learning the basics makes it much easier to learn to think like a game programer, without turning it into a really daunting task. (seriously, just sitting down and saying 'how do i want to have the save system set up, what about the maps and mobs?' seems REALLY scary if you're doing it all in 1 go) Their explanations on things in game programing can also help you come up with with some good ideas on how you want to do things:

For instance, while i was watching TheChernoProject's and coding along (he has the BEST explanations for just about everything, with the exception of saving, even if he does use Notch's codes for the starter) when he explained how his mapping code worked, i actually thought up a really good way of doing something that i hadn't been able to figure out until then:

The idea i got? Well, that was how to do chunk-loading, of course (which he doesn't actually cover, but that's kind of what i mean by getting inspired by their explanations:
Quote
Chunk loading ideas:
(Idea 1)
- As terrain is basically read from a text file, then placed on the screen, then having each world made
   out of multiple text files, with each text file holding 4 16x16 (or 32x32) grids of blocks
   (background, wall art, front, extra art), and have the game load each one when the camera
   screen is within 4 blocks of that chunk. (base which map should be loaded by the ID)
- The chunk loading guide file should be handled like this:
- Map Ids are composed of 4 numbers, with each number having 4 sets of letters:
   x---y---xn---yn---
   
   If(PlayerWalkingLeft==true & x == 0)xn++;
   If(PlayerWalkingRight==true & xn == 0)n++;
   If(PlayerWalkingLeft==true  & x > 0)x--;
   If(PlayerWalkingRight==true & xn > 0)xn--;

   If(PlayerWalkingDown==true & y == 0)yn++;
   If(PlayerWalkingUp==true & yn == 0)y++;
   If(PlayerWalkingDown==true & y > 0)y--;
   If(PlayerWalkingUp==true & yn > 0)yn--;

   LoadMap('x' + x.toString() + 'y' y.toString() + 'xn'+ xn.toString() + 'yn' +yn.toString());

- xn and yn stand for 'x-negative' and 'y-negative'. this should allow for sudo negative numbers (since java doesn't allow for negitives T_T).
have the game use Xn for negative x, and Yn for negative y.
if(x=0){}

As for the actual game itself, i started writing the basics of what i wanted, which started off like this (yes, this is actually the original file, with the exceptions of the edit notes, lol):

Quote
Name: Huh (Name ideas so far: Lemuria, expanse, blank world, or just call it chicken and let people wander why)
Game type 1: Rpg (quest, mobs, exploration)
Game type 2: Adventure (LOTS of exploration)

Character custamization: find out how hard this is. i think it would be a int[] based thing, with each slot corresponding to a
                                   specific body part or something, and each number representing which image to use. (note: it is)
Species: have the player be able to choose their species, have many different speces (maybe make them randomize, with
                                   their body parts be picked out of a random 'body parts:
                                                      -Heads
                                                      -Head extras
                                                      -Torso
                                                      -Torso extra
                                                      -arms
                                                      -hands
                                                      -legs/fins
                                                      -feet/flippers
                                                      -tails
                                                      -wings

Special things: Farming, crafting, mining, fishing (erm... harvesting maybe...)
Combat system: Anything but overworld fighting. i HATE ZELDA STYLED FIGHTING SYSTEMS
                       (note: was i on something when i wrote that? lol, this is actually what i went with)

Art type: 2d tile style (old school rpg, like star ocean 2, golden sun, final fantasy 1-6), not iso, side scrolling platform, or 3d
                       (dear god, find out if 3d is really as hard as it looks) (Note: it is)

Pet system: player should be able to either capture or by pets, or maybe recruit people instead (or both)
crafting system: DON'T DO THE REDICULOUS 'by the recipe' crafting system! I HATE THIS SYSTEM. Maybe make it modular instead?
Ship system: Make modular ships.
Weapon system: MODULAR WEAPONS! i hate it when games have only a hand full of weapons. (also make explody things)

housing system: Player can by land or build anywhere (decide later), houses should be modular inside, but house graphic should be
                       based on basic 'build' or 'basic house design'. or something.
storage system?: no idea how to do this.
Inventory system: Make the inventory size based on a changeable int, so that the size can be 'upgraded'.
                       (base size 10-20, somewhere in there)

Exta notes: make as much of it as possible be randomly generated.
Masic: Basic spells, healing, fire, water, lightning

Modding: Make it possible for players to mod it.
Multiplayer: figure out how to do this, and if it's worth going into)
BIG NOTE: MAKE ENDLESS. spores' supposed 'endlessness' sucked, make an actual endless game, or a game that is as good as endless.

Then i went in depth about everything that i wanted. i detailed the mobs i wanted (even went into how many different slimes i want, every rpg needs it's obligatory slimes) the weapon 'parts', the 'ores' and 'mine-able things'. and all of that, and then i thought about how i would do them. (chunk-loading came up during this, which is when i started having problems)

Anyway, the first 2 things you need to do, is think about what you want, and learn the basics. here are 2 tutorial series that you should watch (both are on going, but they already have everything you need):

https://www.youtube.com/user/TheChernoProject - I learned MOST of what i needed from watching TheChernoProject's first 20-30 videos on his 'java game programming tutorials' (NOT THE 3D ONES! just the regular)
http://www.youtube.com/user/MrDeathJockey - MrDeathJockey's videos taught me what Thechernoproject didn't. (I only watched MrDeathJockey 'java intermediate tutorials')
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.

Riven (12 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!