Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
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  
  StrafeFighter source code  (Read 5271 times)
0 Members and 1 Guest are viewing this topic.
Offline ShannonSmith
« Posted 2008-09-08 02: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 Coder


Medals: 4



« Reply #1 - Posted 2008-09-08 05:49:25 »

Very handy tut on procedural textures.

Current project - Rename and Sort
Offline SwampChicken
« Reply #2 - Posted 2008-09-08 09:11:26 »

Thanks for the up.
Much appreciated!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #3 - Posted 2009-01-26 19: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
« Reply #4 - Posted 2009-01-26 19: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
« Reply #5 - Posted 2009-01-26 20:06:54 »

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

People make games and games make people
Offline h3ckboy

JGO Coder


Medals: 5



« Reply #6 - Posted 2009-01-26 20: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
« Reply #7 - Posted 2009-01-26 22: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 Coder


Medals: 5



« Reply #8 - Posted 2009-01-27 15: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
« Reply #9 - Posted 2009-01-27 18: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jono
« Reply #10 - Posted 2009-01-27 19: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 Coder


Medals: 5



« Reply #11 - Posted 2009-01-27 19: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]
  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.

radar3301 (12 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (28 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (103 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!