Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (428)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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  
  how to make a soccer game in 2D with java?  (Read 2377 times)
0 Members and 1 Guest are viewing this topic.
Offline spider17

Junior Newbie





« Posted 2013-01-15 23:30:34 »

Hi

I'm new and I want to make a simple 2D soccer game using java  Huh

Can you help me please ?

Cordially
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 121
Projects: 4
Exp: 3 years



« Reply #1 - Posted 2013-01-15 23:49:11 »

1. Learn Java
2. Open Eclipse/Netbeans etc.
3. (Optional) Use tutorial.
4. Start.

Your question is really vague...
Offline HeroesGraveDev

JGO Kernel


Medals: 215
Projects: 11
Exp: 2 years


If it wasn't Awesome, it wasn't me.


« Reply #2 - Posted 2013-01-16 00:01:44 »

Jimmt's answer was a little bit vague. I can do better. Grin

No. We can't help you.

(unless you give us more information)

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

Junior Newbie





« Reply #3 - Posted 2013-01-16 00:10:29 »

1. Learn Java
2. Open Eclipse/Netbeans etc.
3. (Optional) Use tutorial.
4. Start.

Your question is really vague...

Thank you for answered HeroesGraveDev et jimmt Smiley

I know java programming
my problem is programming multithreding, I'm not very good  Cry
To begin, I want to know how the java classes organized for the game of soccer?
What are the classes that I have created?
Should I create a UML diagram? if yes how?

I know UML, computer science student I

Here I hope to have had a little more specific

Cordially
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 121
Projects: 4
Exp: 3 years



« Reply #4 - Posted 2013-01-16 00:14:53 »

Don't worry about multithreading too much, it'll honestly make your game slower if you don't get it perfect, not to mention that 2D starter game probably doesn't require too much optimization anyways.
UML diagrams are ok, but usually I just envision/draw my class architecture. Everything falls in place after that.
If you're a cs student, I'm kind of curious as to why you don't know which classes to make, but I would start with a main class (SoccerGame or something), a Player class (could have both same-team and opposing team classes), a Team class with a list/array of players, a Ball class, and maybe a custom swing component extending JFrame or JPanel.
Offline spider17

Junior Newbie





« Reply #5 - Posted 2013-01-16 00:25:09 »

Don't worry about multithreading too much, it'll honestly make your game slower if you don't get it perfect, not to mention that 2D starter game probably doesn't require too much optimization anyways.
UML diagrams are ok, but usually I just envision/draw my class architecture. Everything falls in place after that.
If you're a cs student, I'm kind of curious as to why you don't know which classes to make, but I would start with a main class (SoccerGame or something), a Player class (could have both same-team and opposing team classes), a Team class with a list/array of players, a Ball class, and maybe a custom swing component extending JFrame or JPanel.

You're right I'll start doing classes you just montionner then I'll show you the evolution of my work in a few days so you can tell me what to change Smiley
Offline sproingie

JGO Kernel


Medals: 200



« Reply #6 - Posted 2013-01-16 00:29:39 »

Perhaps it's merely a language barrier, but if you already know java programming, you wouldn't need to ask how to organize java classes for a soccer game.  This isn't to say every programmer knows how to organize those classes, but experience in design means you should at least have a rough idea.

Learn to walk before you run, write it without multithreading first.  

Throw your UML tool out.  Useful as UML is for explaining designs to others, it's pointless overkill for simple single-developer apps.

Start simple, and with a high level library like Java2D, LibGDX, or Slick2D
 
Offline Ultroman

JGO Knight


Medals: 24
Projects: 1


Snappin' at snizzes since '83


« Reply #7 - Posted 2013-01-16 00:45:04 »

I must agree with sproingie.

I think you need to read up on how games work. Probably doing a quick Pingpong game will teach you a lot. I base this on your reference to multithreading in a soccer game, which leads me to believe that you think a game is this living thing, which has multiple processes going at once, like the ball moving by itself in one thread and each player using his own thread. This is NOT the case, and this approach should never be used.

A game normally consists of a gameloop, which updates all the processes in the game, usually moving things along using a deltaTime (the time elapsed since the last update). This can be done each frame or as often as you'd like, depending in which type of gameloop you implement. There are plenty of good threads about gameloops on this forum, and I'm sure you can find a simple Pingpong tutorial somewhere on the web.

Good luck with it!

- Jonas
Online actual

JGO Coder


Medals: 24



« Reply #8 - Posted 2013-01-16 00:54:13 »

Max Buckland wrote Programming Game AI by Example which is a great introduction to various AI techniques. His chapter 4 is called "Simple Soccer" where he implements the AI for a simple soccer game. The code is in C++ but you should be able to port the class structure over to Java pretty straight forwardly.

With some googling, it looks like someone has gone through the effort of porting the examples to Java. I can't vouch for the quality of the code as I have not looked at it but it should give you a good head start.
Offline ReBirth
« Reply #9 - Posted 2013-01-16 03:37:40 »

One doesn't simply come to Java forum and ask the best organized classes. No. It's same with you come to comic-con and ask with loud speaker who is the best super hero.

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

JGO Kernel


Medals: 215
Projects: 11
Exp: 2 years


If it wasn't Awesome, it wasn't me.


« Reply #10 - Posted 2013-01-16 03:56:49 »

One doesn't simply come to Java forum and ask the best organized classes. No. It's same with you come to comic-con and ask with loud speaker who is the best super hero.

You forgot something.

@OP: Rebirth is right. You need to think for yourself sometimes. (Oh wait, he meant that you get an argument. Oh well, now you have another reason)

Offline ReBirth
« Reply #11 - Posted 2013-01-16 04:17:38 »

Thanks, save my time for making meme.

Unless you're a minion on an enterprise dev team, dont bother and just do it. The reason why ppl encouraging good organized classes is because they pity on you, who struggling on debugging and hurt own eyes with dat scrolling and ugly code. But if you don't mind it and just need to get thing done, then dont worry.

Offline Varkas
« Reply #12 - Posted 2013-01-16 15:21:50 »

Unless you're a minion on an enterprise dev team, dont bother and just do it.

Said minions are well advised to not bother either and just do as they are told to. Makes their boss happy and saves them headaches Tongue

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #13 - Posted 2013-01-17 17:22:56 »

Unless you're a minion on an enterprise dev team, dont bother and just do it.

Said minions are well advised to not bother either and just do as they are told to. Makes their boss happy and saves them headaches Tongue


That's if you have a boss that knows how to code. Smiley

I had a software manager once that didn't know anything about coding and determined your performance based on lines of code....it was hell.

-Pickle

Offline ReBirth
« Reply #14 - Posted 2013-01-18 03:42:34 »


That's if you have a boss that knows how to code. Smiley

I had a software manager once that didn't know anything about coding and determined your performance based on lines of code....it was hell.

-Pickle
Yeah me too. It happened when I made an enterprise for someone who non-computer based. Revisions hell.

Offline BoBear2681

JGO Coder


Medals: 18



« Reply #15 - Posted 2013-01-18 04:10:22 »

I had a software manager once that didn't know anything about coding and determined your performance based on lines of code....it was hell.

You had a manager that read through your code?  That in and of itself is strange to me.  Unless you're saying he gauged your performance based on `wc -l`, like the old joke, in which case I don't see the problem - that's easily abusable in your favor...
Offline Pickleninja

JGO Coder


Medals: 10
Projects: 1


I'm tired of working for someone else.


« Reply #16 - Posted 2013-01-18 18:33:27 »

I had a software manager once that didn't know anything about coding and determined your performance based on lines of code....it was hell.

You had a manager that read through your code?  That in and of itself is strange to me.  Unless you're saying he gauged your performance based on `wc -l`, like the old joke, in which case I don't see the problem - that's easily abusable in your favor...

He didn't go line by line, but basically I was working on a system that was in a maintenance phase, and he would look at the printed copys of code where your changes were highlighted. If there wasn't much highlighted text, he would wonder "what were you doing all day?"

He was a bitter bitter pill Smiley

-Pickle

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.

xsi3rr4x (79 views)
2014-04-15 18:08:23

BurntPizza (71 views)
2014-04-15 03:46:01

UprightPath (82 views)
2014-04-14 17:39:50

UprightPath (66 views)
2014-04-14 17:35:47

Porlus (82 views)
2014-04-14 15:48:38

tom_mai78101 (106 views)
2014-04-10 04:04:31

BurntPizza (166 views)
2014-04-08 23:06:04

tom_mai78101 (262 views)
2014-04-05 13:34:39

trollwarrior1 (212 views)
2014-04-04 12:06:45

CJLetsGame (221 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!