Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
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  
  Suggest a project to the new guy!  (Read 3653 times)
0 Members and 1 Guest are viewing this topic.
Offline Eyesackery

Junior Member


Medals: 1



« Posted 2012-07-04 03:45:26 »

Hey guys I'm new to these forums, as well as being relatively new to games programming with Java. I've done a introductory course at University on Java and I'm super keen to get neck deep in some serious games coding! So far I've just been doing tutorials on-line based around clones of old arcade games like pong, pacman, tetris, etc. They have been fun but the challenge is kind of lost seeing as all the code for the games are provided for you! Although I have learned a lot within the Java 2D library and have become fairly confident in OOP design and implementation.

Here is what I propose to anyone with any spare time and an interest in helping a new enthusiastic coder.

I need a problem to work on, that is relatively basic yet still challenging. The idea being I will post all my progress in this thread and everyone can offer suggestions or give 'hints' to the problems that I may face. The problem doesn't have to be huge, maybe even something as simple as move a sprite with the keyboard and shoot at a target, that sort of thing.

I may be going out on a limb here, but I know there are some seriously talented programmers on these forums! I see this as a awesome learning experience.

Thanks for your time! ( please excuse my enthusiasm! )  Grin
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2012-07-04 04:09:35 »

Welcome to JGO, Eyesackery!

I love your enthusiasm for making games! Keep it up and you will go far in life, but don't get bogged down by the 'boring' parts Wink

Based on your experience, I say you should start learning OpenGL to be able to grasp the full power of the graphics card to make some visually attractive games.

Good luck! Grin

Offline Eyesackery

Junior Member


Medals: 1



« Reply #2 - Posted 2012-07-04 04:19:50 »

Thank you for your suggestion ra4king  Smiley

Eep! OpenGL and 3D programming seems a little daunting to me but I'm up for the challenge!

Can you suggest any good material on-line to get me started?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #3 - Posted 2012-07-04 07:07:22 »

You're in luck! These tutorials are the best around. However, the code is in C++ but you can find the LWJGL ports over here.

However, if you are confident enough that you don't need someone's else code, you can very easily "port" the C++ code yourself. Since LWJGL copies almost all functions exactly, it is safe to assume all functions you see that start with 'gl' are almost exactly the same as in LWJGL. Only one exception, function calls starting with 'glut' is just the windowing API. In LWJGL, that's simply your Display class.

Offline Sickan

Senior Member


Medals: 8



« Reply #4 - Posted 2012-07-04 08:59:21 »

You're in luck! These tutorials are the best around. However, the code is in C++ but you can find the LWJGL ports over here.

However, if you are confident enough that you don't need someone's else code, you can very easily "port" the C++ code yourself. Since LWJGL copies almost all functions exactly, it is safe to assume all functions you see that start with 'gl' are almost exactly the same as in LWJGL. Only one exception, function calls starting with 'glut' is just the windowing API. In LWJGL, that's simply your Display class.
What about these tutorials? They're also pretty great.
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #5 - Posted 2012-07-04 09:20:01 »

I heard those articles are really old and outdated. If they have been updated, I'm not aware of it.

The tutorial I linked to is an excellent tutorial on modern OpenGL.

Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 128
Projects: 4
Exp: 3 years



« Reply #6 - Posted 2012-07-04 10:45:28 »

You might want to make something in java2d before OpenGL.
As for the actual project, how about:
-a scrolling shooter
-street fighter style game
-tower defense

You can make pretty simple games of the above type.


Offline pjt33
« Reply #7 - Posted 2012-07-04 23:34:40 »

I need a problem to work on, that is relatively basic yet still challenging.
Write an early entry for next year's Java4k contest. Plenty of material in the relevant subforum.
Offline Eyesackery

Junior Member


Medals: 1



« Reply #8 - Posted 2012-07-06 06:37:20 »

Thanks a lot for the awesome replies guys! Very much appreciated!  Cheesy

@ra4king - That book looks great! Definitely going to set aside some study time for those! Thank you!

@Sickan - That website looks awesome too, lots of information on beginning games programming in OpenGL, thanks!

@Jimmt - Thanks for the suggestions man! I've been kind of working on a little project I'll talk more about it below Smiley

@pjt33 - That sounds like a very good plan, why didn't I think of that!? haha, thanks man. Smiley


So I jumped the gun a little and have been working on a bit of a project for the last few days, based of a few tutorials laying around online. However I'm stuck!

I'm trying to implement a "point and shoot at mouse", type of function, and so far I have been able to get the angle and position of the mouse on mouse clicks. The ship is at the bottom of the screen shooting upwards, so I only use 180 degrees in the equation.

But I'm stumped as to how to fire at that position?

This is how I'm calculating the angle and position of the mouse currently.

1  
2  
double anglePi = Math.atan2(mouseY - ship.y, mouseX - ship.x) * 60;
int angle = (int) Math.abs(anglePi);


Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #9 - Posted 2012-07-06 06:46:50 »

Math.atan2 returns an angle in radians, not degrees so leave it as a double Wink
Multiplying an angle by 60 (or anything) makes no sense really Tongue
Also, negative degrees/radians is definitely not the same as positive degrees/radians.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eyesackery

Junior Member


Medals: 1



« Reply #10 - Posted 2012-07-06 07:30:34 »

 Undecided Essshh, looks like I need to brush up on a few of my maths skills!

I knew I should have been listening during high school!  Tongue

So I found a pretty helpful post in a action scripting forum that helped to solve my problem Smiley

http://www.actionscript.org/forums/showthread.php3?t=251651
Offline pjt33
« Reply #11 - Posted 2012-07-06 08:23:44 »

Multiplying an angle by 60 (or anything) makes no sense really Tongue
That's not true. Multiplying by 60 and then truncating is an effective way to quantise, which is necessary if you use prerendered graphics in N rotations or convenient if you use lookup tables for trig.
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #12 - Posted 2012-07-06 09:42:31 »

Multiplying an angle by 60 (or anything) makes no sense really Tongue
That's not true. Multiplying by 60 and then truncating is an effective way to quantise, which is necessary if you use prerendered graphics in N rotations or convenient if you use lookup tables for trig.
Hey there's that swooshing sound over my head again! Grin

Offline Eyesackery

Junior Member


Medals: 1



« Reply #13 - Posted 2012-07-07 06:15:52 »

So I've been cruising through the space invaders 101 tutorial on coke and code (http://www.cokeandcode.com/index.html?page=tutorials/spaceinvaders101), and have been trying to do some of the challenges after the tutorials.

I'm having trouble with getting the aliens to fire back.

To me this looks like it should be working, but unfortunately it does not.

Any help or hints would be very much appreciated, this has been so frustrating  Cry.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
         for (int i = 0; i < entities.size(); i++){
           
            Entity entity = (Entity) entities.get(i);
           
            if (entity.equals(alien)) {
           
                randomAlien =  rand.nextInt(entities.size());
               Entity alienShooting = (Entity) entities.get(randomAlien);
               alienShot = new AlienShotEntity(this,"sprites/shot.gif",alienShooting.getX() + 13,alienShooting.getY(), angle);
               entities.add(alienShot);
               break;
            }
         }
           
     
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #14 - Posted 2012-07-07 06:28:49 »

What's the "alien" variable? If you have many aliens, why are you only checking against 1?

Offline Eyesackery

Junior Member


Medals: 1



« Reply #15 - Posted 2012-07-07 06:39:15 »

I'm trying to check for every 'alien' in the array list. I'm not very confident with array lists Smiley
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #16 - Posted 2012-07-07 07:00:15 »

"entity.equals(alien)" <== that checks against only 1 instance of alien. If you want to check if an Entity is an instance of Alien, you would want: "if(entity instanceof Alien)" or whatever your Alien class is called.

Offline Eyesackery

Junior Member


Medals: 1



« Reply #17 - Posted 2012-07-07 07:09:39 »

Ra4king! I think I love you!! Haha. Smiley that solved my problem, thank you! I have been pulling my
Hair out for hours over that one! Cheers!
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #18 - Posted 2012-07-07 08:42:07 »

Haha glad to help Smiley

Offline Eyesackery

Junior Member


Medals: 1



« Reply #19 - Posted 2012-07-11 13:51:47 »

Hi guys, still been working away at my little Java 2D project and have had a million ideas for a more in depth game. I can finally see how it's possible to build games from my own imagination now, which is exciting!  Grin

Like you guys suggested I'm going to start becoming familiar with OpenGL and the JLWGL.

I'm under the impression that the only way to use the JLWGL is through Slick2D?

I'm a little confused, are JLWGL and Slick2D just 2 different libraries? How do they work together?

If I wanted to user the JLWGL and Slick2D for my next project, where should I start? ( where/how to learn ).

Here's a little screen of what I've been working on.

Offline Phased
« Reply #20 - Posted 2012-07-11 14:00:31 »

its LWJGL not JLWGL to start of with Tongue

you don't need Slick2d to use LWJGL, Slick2d you could say allows for newer people to use LWJGL and harness its awesomeness, but still be easier then LWJGL.

cokeandcode.com is where you get it, and also has tutorials

slick.cokeandcode.com/

for tuts
http://slick.cokeandcode.com/wiki/doku.php?id=tutorials
Offline Eyesackery

Junior Member


Medals: 1



« Reply #21 - Posted 2012-07-11 14:06:54 »

its LWJGL not JLWGL to start of with Tongue

you don't need Slick2d to use LWJGL, Slick2d you could say allows for newer people to use LWJGL and harness its awesomeness, but still be easier then LWJGL.

cokeandcode.com is where you get it, and also has tutorials

slick.cokeandcode.com/

for tuts
http://slick.cokeandcode.com/wiki/doku.php?id=tutorials

God I'm an idiot sometimes!  Cheesy I hate being a total noob, it's embarrassing!

Cheers for the links man! Will get cracking on those tutorials first thing  Smiley
Offline ra4king

JGO Kernel


Medals: 336
Projects: 2
Exp: 5 years


I'm the King!


« Reply #22 - Posted 2012-07-11 14:31:48 »

Sweet screenshot! How did you do that deterioration of the shields effect?

Concerning Slick2D, it's a wrapper over LWJGL. It has an API very similar to Java2D but it uses LWJGL underneath. It's mainly for people who want to make games with full hardware acceleration but don't want to get into the specifics of OpenGL.

Offline Eyesackery

Junior Member


Medals: 1



« Reply #23 - Posted 2012-07-11 15:44:02 »

Sweet screenshot! How did you do that deterioration of the shields effect?

Concerning Slick2D, it's a wrapper over LWJGL. It has an API very similar to Java2D but it uses LWJGL underneath. It's mainly for people who want to make games with full hardware acceleration but don't want to get into the specifics of OpenGL.

Thanks man!  Smiley For the deterioration effect I just had 4 different sprites loaded into an array, (no damage, little damage, little more damage, and really damaged). Then depending on the "health" of the shields an appropriate sprite was displayed.

That makes total sense now, thanks for explaining that. Smiley
Offline davedes
« Reply #24 - Posted 2012-07-11 16:03:48 »

Just a heads up -- Slick's website is currently out of date. For the latest version of Slick, you should pull it from bitbucket. More info:
http://slick.javaunlimited.net/viewtopic.php?f=3&t=5171

I'd also suggest upgrading to the latest LWJGL since Slick ships with an older version.

Offline Eyesackery

Junior Member


Medals: 1



« Reply #25 - Posted 2012-07-12 03:00:43 »

Just a heads up -- Slick's website is currently out of date. For the latest version of Slick, you should pull it from bitbucket. More info:
http://slick.javaunlimited.net/viewtopic.php?f=3&t=5171

I'd also suggest upgrading to the latest LWJGL since Slick ships with an older version.

Sweet, thanks for the heads up! I'm really liking Slick so far, it makes everything so easy! Smiley Let's you fully concentrate on the awesome game you want to make, without having to worry about to many technical limitations.
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.

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

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

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

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

ctomni231 (48 views)
2014-07-18 06:55:21

Zero Volt (44 views)
2014-07-17 23:47:54

danieldean (35 views)
2014-07-17 23:41:23

MustardPeter (38 views)
2014-07-16 23:30:00

Cero (53 views)
2014-07-16 00:42:17

Riven (53 views)
2014-07-14 18:02:53
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!