Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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 4601 times)
0 Members and 1 Guest are viewing this topic.
Offline ShannonSmith
« Posted 2008-09-08 04: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 07:49:25 »

Very handy tut on procedural textures.

Current project - Rename and Sort
Offline SwampChicken

Senior Member


Medals: 1



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

Thanks for the up.
Much appreciated!
Games published by our own members! Check 'em out!
Try the Free Demo of Revenge of the Titans
Online h3ckboy
« Reply #3 - Posted 2009-01-26 20: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 20: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 21:06:54 »

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

Heroes' Keep is in development.
Meanwhile try Bloodridge
Online h3ckboy
« Reply #6 - Posted 2009-01-26 21: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 23: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.
Online h3ckboy
« Reply #8 - Posted 2009-01-27 16: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 19: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

Senior Member


Medals: 1
Projects: 1



« Reply #10 - Posted 2009-01-27 20: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.
Online h3ckboy
« Reply #11 - Posted 2009-01-27 20: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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (76 views)
2013-05-17 21:29:12

alaslipknot (87 views)
2013-05-16 21:24:48

gouessej (117 views)
2013-05-16 00:53:38

gouessej (112 views)
2013-05-16 00:17:58

theagentd (125 views)
2013-05-15 15:01:13

theagentd (112 views)
2013-05-15 15:00:54

StreetDoggy (156 views)
2013-05-14 15:56:26

kutucuk (178 views)
2013-05-12 17:10:36

kutucuk (178 views)
2013-05-12 15:36:09

UnluckyDevil (185 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.103 seconds with 21 queries.