# ufo design

This topic is 2249 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Let me know if this is good design for UFO game.
Superclass is UFO.
Subclass is UFO_Up_and_Down. (moves up and down)
Subclass is UFO_Side_to_Side. (moves side to side)
Subclass is Kamikaze_UFO. (goes straight for the player)
Subclass is Slider_UFO. (moves across screen from right to left or vice versa)
Subclass is Sine_Slider_UFO. (moves across screen from right to left but with sine bobbing motion)
Subclass is Hammer_UFO. (slides in from right or left to player's x coordinate… then drops!)
So, there will be a virtual method called move:
virtual void move(void)

##### Share on other sites
You haven't given me any information to determine if this is "good" or not, remember that something being good is relative.

If I'm correct in assuming this is like Space Invaders, I'd say yes it is good.

##### Share on other sites
I'm not to sure here if you are looking for programming assistance, or design assistance, but either way you haven't really given enough information to know what your question is really asking.

##### Share on other sites
This is a programming related question.
Bad design. You can do everything with a single class and a supporter class controlling it. This class could be something like
 class UFOTargetProvider { public: virtual single3 GetTarget() = 0; }; class UFOPatrollerTarget : public UFOTargetProvider { double time; const single3 from, to; public: UFOPatrollerTarget(single3 p0, single3 p1) : from(p0), to(p1) { } void Tick(double inc) { time += inc; } single3 GetTarget() { if(int(time / period) % 1) return to; return from; } }; UFO(UFOPatrollerTarget(SCREEN_LEFT, SCREEN_RIGHT); // equivalent to UFO_Side_to_Side (terrible naming by the way) UFO(UFOPatrollerTarget(SCREEN_UP, SCREEN_DOWN); // equivalent to UFO_Up_and_Down 

##### Share on other sites

You haven't given me any information to determine if this is "good" or not, remember that something being good is relative.

If I'm correct in assuming this is like Space Invaders, I'd say yes it is good.

Yes. Like space invaders.
Thanks.

1. 1
2. 2
Rutin
23
3. 3
4. 4
frob
16
5. 5

• 9
• 33
• 13
• 12
• 10
• ### Forum Statistics

• Total Topics
632579
• Total Posts
3007168

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!