Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (780)
Games in Android Showcase (233)
games submitted by our members
Games in WIP (857)
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  
  Whats the best startup code for a java2d game ?  (Read 3453 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Posted 2003-05-01 22:50:55 »

Well you know:

- Setting up full screen

-  Quering and allocating the right buffers (after setting full screen)

- Setting up the events to dismiss all those swing and awt unnecessary stuff

- building the right class and callback methods and swap buffers at the right times

- setting up the right game cycle:
setup, (read input, process input, render and swap buffer)*, cleanup and exit

Any idea on the best way to do this ?
Offline mill

Junior Devvie

popcorn freak

« Reply #1 - Posted 2003-05-02 09:33:03 »

this might get you up and running;action=display;num=1036791657

Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #2 - Posted 2003-05-03 10:06:31 »


That looks good thanks.

As anyone tried to do a 2d scene graph ?

Are there any alternatives for the game interface instead of using awt (i mean for the requirements of 2d game ) ?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline JuddMan

Senior Devvie

Medals: 1

Your Ad Here

« Reply #3 - Posted 2003-05-04 04:41:39 »

if you're going to use that windowed BufferStrategy example and do it like that, i dont think you can use AWT or Swing components.

With a bit of planning you can make your own classes that manage how the various sprites/tiles/GUI stuff display.

by 2d scene graph i assume you mean a tile map?

it's not hard to do. Easy way is to have a 2d Tile[][] array (you've probably already done this) and in a double for loop, do something like drawImage(tile[j], i*32, j*32, null) (if your tiles are 32x32)

for scrolling tile maps and ones that are larger than the screen you'll have to make a minor alteration that paints only those tiles that are visible to save on processing power, and just use an X offset and a Y offset, for example, to adjust the location of the tiles.

if you need more detail, just ask.
Offline Abuse

JGO Ninja

Medals: 71

falling into the abyss of reality

« Reply #4 - Posted 2003-05-04 10:36:55 »

A 2D scene graph is far more than a simple tile map.

I've never come across 1 myself - but then again - i've never looked.
Offline zingbat

Senior Devvie

Medals: 1

Java games rock!

« Reply #5 - Posted 2003-05-06 18:32:48 »

My idea of a 2d scene is something similar to the java3d scene graph but with a 3rd coordinate for z ordering of sprites (in screen coordinate system).

I think that having some sort of behaviours like in java3d would be could and maybe 2d  positional sound.

It would have have tiles of course, but in a sort of Tile node and probably the possibility for several projections (isometric , top, front, side) to view the maps.

The 2d interface would be a part of the 2d scene graph.

Anyway I have to think better on this since nobody has ever done anything similar for what I have been able to search in the net.
Pages: [1]
  ignore  |  Print  

hadezbladez (761 views)
2018-11-16 13:46:03

hadezbladez (391 views)
2018-11-16 13:41:33

hadezbladez (758 views)
2018-11-16 13:35:35

hadezbladez (200 views)
2018-11-16 13:32:03

EgonOlsen (2401 views)
2018-06-10 19:43:48

EgonOlsen (2581 views)
2018-06-10 19:43:44

EgonOlsen (1486 views)
2018-06-10 19:43:20

DesertCoockie (2149 views)
2018-05-13 18:23:11

nelsongames (1967 views)
2018-04-24 18:15:36

nelsongames (2648 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!