Looking for help (2D Java)

Hey guys…

I am programming Java since 5 month. I have experience in Php, SQL und C++. But I need some help to start a game. I had written 2 browsergames, but this was easy to handle with graphics. Just loading new images and so on…

But in Java it is not so easy. I am looking for an tutorial to programming games in java. Does anybody have so a tutorial?

To blow my own trumpet, you might take a look at:

http://grexengine.com/sections/externalgames/articles/Kevin%20Glass-Space%20Invaders%20101-1.html

Kev

oh, cool.

Thanks for the tutorial.

But I am looking for a game tutorial like http://www.puzzle-piraten.de/ . This is a funny game. But how did it realised???

Ah Puzzle Pirates! Its essentially the same technology just more so.

Kev

Realy?

But how does it work with the graphics… if anybody goes 2 steps right. Must the screen complete repaint?

And does they use a database or how could the player communicate?

I programmed browsergames, but that was easy. I just read the database or update the database. Functioned that similarly?

Sorry for the bad english, i come from germany… :’(

[quote]But how does it work with the graphics… if anybody goes 2 steps right. Must the screen complete repaint?
[/quote]
Some older games (a long, long time ago, in a galaxy far, far away…) used what’s called “Dirty Rectangle” painting, which amounts to redrawing only the areas that have changed. This worked okay for large areas where only a little bit changed. However, when you add in scrolling, special effects, cool text popups, etc., it just gets easier to repaint the entire screen. Modern hardware has more than enough horseypower to do it, so don’t fret full screen repaints.

[quote]And does they use a database or how could the player communicate?
[/quote]
How do you mean? They probably have a database to keep track of players, stats, and other persistent information, but actual communication is probably done in a client/server fashion.

[quote]I programmed browsergames, but that was easy. I just read the database or update the database. Functioned that similarly?
[/quote]
Sort of. The difference is that you really need to develop your own client server protocol (or purchase a $$$ package to do it for you).

[quote]Sorry for the bad english, i come from germany… :’(
[/quote]
It’s okay. As long as you take the time to do the translation as best as you can, we’ll happily work with you. :slight_smile:

With the communication, I just mean for example

a player write a message to an other player. Then must it INSERT into a database and then I must read for example every second if the player has a new message or how does it work?

well this is more a Networking problem than rather a Design Problem.

Normally, you have outgoing messages queues, a Thread sending messages and a Thread receiving them (or with NIO a single thread does both) and then you just add the message to the respective Player Queue.

Yes, but normaly its a database. Because it is easy and you can see what player write and control if anybody write bad thinks about other players…

Ok, thanks for the good answers…

[quote]With the communication, I just mean for example

a player write a message to an other player. Then must it INSERT into a database and then I must read for example every second if the player has a new message or how does it work?
[/quote]
In short, -->** NO!! **<–

For the longer answer, go here. Ignore the section on multicasting, it’s not well supported by the internet.

You want to use client-server in addition to a database (ie, use both). The database is used for persistent information. That is, information that stays around after they are logged off. User-name, password, level or how many points they have, location, etc. The server relays temporary messages (stuff that could be lost with out consequences if they disconnected suddenly). Text messages, X-Y movement on screen, a challenge to play a contest, etc. all should be handled by the server, not a database.

For more information, the whole tutorial is here.