Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (468)
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  
  Newbie tutorial.....  Use or Abuse  (Read 1643 times)
0 Members and 1 Guest are viewing this topic.
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Posted 2004-04-08 22:06:06 »

3 x Blah was asking for tutorials in another thread.  This is one I wrote a while back.  I did a quick Composer job on the text so the html isn't so great and of course IE messes with the fixed width tags so the source looks screwy on IE.  

Its all AWT and applets.  It assumes the user already knows some java.  It was intended as a starting point to java gamedev.  It includes source and an example applet.

Its way out of date now, both with java and my own skills.  So feel free to critique it and make suggestions.

Click here.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #1 - Posted 2004-04-08 22:28:03 »

Seems pretty good actually. Apart from some omissions - like explaining why you overrode update(): the para looks self-contradicting without the explanation. Also some errors (stuff which I suspect you probably understand better now if you were rewriting this).

Would you (or someone else who's been doing applet coding recently) consider updating this a bit, making a few corrections, and then I'll put it on JGF.

Which makes me realise: if I'm going to post articles on JGF, I need a pool of volunteer article-reviewers, who can quickly read through them before they get published, and check for places where things are incorrectly described, or something is done wrong.

E.g. in a swing tutorial, if I saw *any* use of
1  
paint( Graphics G )
I know it's wrong (unless there's a para explaining why the author is breaking Swing deliberately - for Swing, you're always supposed to use paintComponent( Graphics g ) where in AWT you would have used paint(...)).

I can do this kind of review myself for a considerable number of the libraries, but there are big areas where I wouldn't recognize such mistakes (especially with any of the techs I don't use, like ODE).

Reviewing articles is a LOT less work than writing them (by a factor of about 10-20) but is equally helpful in getting articles on the web for other peopl to use. So, if you have the skills but not the time for writing articles, please could you help with this? Email me or message me, saying what areas (e.g. "swing, JOGL, OpenGL") you feel capable of reviewing articles for.

malloc will be first against the wall when the revolution comes...
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #2 - Posted 2004-04-09 16:12:47 »

I thought about converting the tutorial and example code to a JApplet using a canvas + bufferstrategy.  No problem there.  But what stopped me was the loading images bit; to preserve transparency I use the image loader class from the wiki and I didn't want to 'steal' the code and put it in the tutorial.

The article covers:

Applets+Event driven programming
Double buffering
Loading graphics
Threads + game loop
Timing
Managing the gc
Input with KeyListener

All these topics would carry straight over to j2d.  Timing is still problematic, especially for an applet, until 1.5 becomes widely used.

I thought about adding a bit about jars and loading images from jars.

I can update it to j2d at some point, I don't know when though.  Maybe after this contest.   If you want to post it as is pm me the other errors you caught and I can update it.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2004-04-09 17:36:56 »

Quote
I thought about converting the tutorial and example code to a JApplet using a canvas + bufferstrategy.


Have you done much with JApplets? Last time I did anything graphics intensive, I found 1.4.x was brkoen  (probably 1.4.1) and couldn't handle JApplet's properly on any platform, and I don't recall if the bug has been fixed yet (it was semi-repeatable: a race conditoin would cause JApplet's sometimes to initialise with an invalid Graphics. The whole applet would run fine, but without any graphics, and there was no way of getting the graphics to come to life wihtout restarting appletviewer / plugin).

malloc will be first against the wall when the revolution comes...
Offline BDNiner

Junior Newbie




Java games rock!


« Reply #4 - Posted 2004-04-24 01:07:00 »

I was messing around with your program and i ran into a problem. how do you keep the transparencies on the sprites?
Offline BDNiner

Junior Newbie




Java games rock!


« Reply #5 - Posted 2004-04-24 01:08:02 »

and what program do you use to draw sprites?
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #6 - Posted 2004-04-24 01:29:02 »

To Blah^3, japplets seem to work fine on jre 1.4.2.

To get transparency you have to save the transparent color with the image like in a gif.  

I use Microsoft Paint that comes with windows.  The version of paint I have on this computer won't save a transparent gif or png, so I draw with ms paint and then i use the the free program irfranview to load the image save it with a trans color.  

You could use any image program though, like gimp, photoshop, paintshop pro etc...
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.

theagentd (6 views)
2014-04-24 23:00:44

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

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

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

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

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

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

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

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

trollwarrior1 (216 views)
2014-04-04 12:06:45
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!