Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (616)
Games in Android Showcase (173)
games submitted by our members
Games in WIP (659)
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 5793 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:

Also to go with it is a tutorial on procedural content generation specifically focusing on the StrafeFighter planets:
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.

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:

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.

Coldstream24 (17 views)
2015-09-02 15:41:28

Andrew_3ds (28 views)
2015-09-01 10:08:10

afikri (19 views)
2015-08-31 00:30:22

afikri (26 views)
2015-08-31 00:30:07

afikri (13 views)
2015-08-31 00:27:24

afikri (17 views)
2015-08-31 00:26:40

Roquen (30 views)
2015-08-29 02:30:54

GamerC4 (37 views)
2015-08-22 11:38:50

GamerC4 (34 views)
2015-08-22 11:37:18

GamerC4 (41 views)
2015-08-22 11:37:01
HotSpot Options
by Roquen
2015-08-29 02:33:11

Rendering resources
by Roquen
2015-08-17 03:42:29

Rendering resources
by Roquen
2015-08-17 00:36:56

Rendering resources
by Roquen
2015-08-12 22:40:51

Networking Resources
by Roquen
2015-08-12 22:40:43

List of Learning Resources
by gouessej
2015-07-09 02:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 02:34:43

List of Learning Resources
by PocketCrafter7
2015-05-30 20:37:30 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!