Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  StrafeFighter source code  (Read 4163 times)
0 Members and 1 Guest are viewing this topic.
Offline ShannonSmith

Sr. Member
**

Posts: 365
Medals: 13



« on: 2008-09-07 22:41:09 »

I've had a few requests for the source code to StrafeFighter and have finally got around to putting on Google Code:
http://code.google.com/p/strafefighter/source/browse/#svn/trunk/src

Also to go with it is a tutorial on procedural content generation specifically focusing on the StrafeFighter planets:
http://www.angryoctopus.co.nz/?page_id=11
Offline zammbi

JGO Strike Force
***

Posts: 963
Medals: 9



« Reply #1 on: 2008-09-08 01:49:25 »

Very handy tut on procedural textures.

Current project - Rename and Sort
Offline SwampChicken

Full Member
**

Posts: 199
Medals: 1



« Reply #2 on: 2008-09-08 05:11:26 »

Thanks for the up.
Much appreciated!
Games published by our own members! Go get 'em!
Offline h3ckboy

JGO Kernel
*****

Posts: 1645
Medals: 4



« Reply #3 on: 2009-01-26 14:11:29 »

hehe I hate to jump in on this but I am just curios did you make a class for every sprite?
Offline ShannonSmith

Sr. Member
**

Posts: 365
Medals: 13



« Reply #4 on: 2009-01-26 14:22:31 »

No, I consider creating a class per sprite (or object type) to be very bad practice. Aggregation over inheritance, there is a good reason for this (there is a very good article lying around on this if you Google it).



Offline SimonH

JGO Strike Force
***

Posts: 896
Medals: 14



« Reply #5 on: 2009-01-26 15:06:54 »

Cool! This could be very handy for the Community Space Trader game!

Stickmen Wars 2 is in development.
Meanwhile try Bloodridge
Offline h3ckboy

JGO Kernel
*****

Posts: 1645
Medals: 4



« Reply #6 on: 2009-01-26 15:24:08 »

if there is another way what is it I will try and find it on google but I have been unable so far Sad.

thx
Offline ShannonSmith

Sr. Member
**

Posts: 365
Medals: 13



« Reply #7 on: 2009-01-26 17:45:37 »

I suspect we may be talking about different things. What exactly do you mean by 1 sprite per class? I have a generic ship object that both the enemy and player ships are instances of. The ship descriptions are in an xml file and created via the ShipGen class.
Offline h3ckboy

JGO Kernel
*****

Posts: 1645
Medals: 4



« Reply #8 on: 2009-01-27 10:39:35 »

what I currently do is have a class that all the sprites extend "Actor" but every individual sprite has a act() method to do what it is supposed to do
Offline ShannonSmith

Sr. Member
**

Posts: 365
Medals: 13



« Reply #9 on: 2009-01-27 13:13:07 »

That is a fairly common model. I don't particularly like it myself, it means every time you want a new type of Actor you have to subclass and write some code which is a bit of a pain. I prefer having a different composition of fixed objects (Weapon, AI, Ship) and have a factory class to put them together for you based on a configuration file.
If you ever find yourself having lots of very empty subclasses you probably want to consider a composition model.
Games published by our own members! Go get 'em!
Offline Jono

Full Member
**

Posts: 143
Medals: 1



« Reply #10 on: 2009-01-27 14:23:04 »

I think this could be the article you're thinking of: http://www.gamearchitect.net/Articles/GameObjects1.html

It makes some good points, though at times it's a bud FUDdish about inheritance. Some of the problems mentioned with inheritance were just poor design decisions. Still, unless your game is never going to be extended and fits an inheritance model perfectly, the aggregation approach seems the way to go.

The real killer comes down to not having multiple inheritance. When different classes need to share more than one bit of code, that whole model falls apart.
Offline h3ckboy

JGO Kernel
*****

Posts: 1645
Medals: 4



« Reply #11 on: 2009-01-27 14:48:29 »

k guys thx I will check it all out in a bit I am just working on a  game right now and there are few enough sprites that the current model works. also i can use a switch to choose which model to use in one class. which is what I am doing now Smiley.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.168 seconds with 20 queries.