Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3979238
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:08:43+00:00 2026-05-20T05:08:43+00:00

I posted not so long ago a class diagram for an application that I

  • 0

I posted not so long ago a class diagram for an application that I am making. Got some helpful tips and went to work. Designing sure is tough! Anyways, I made a version 2.0, but ran into other things. Maybe somebody could give pointers, or comments, or advice concerning my class diagram 🙂

Space Invaders Architecture V. 2.0

First I had ‘Speed’ in SomeInterface as part of the Sprite abstract class. After consideration I figured that this was not the best place to put ‘Speed’. A not so good thing was that I was not able to give a proper name to the interface, and that I didn’t know where to put ‘Speed’, in the Attribute or Operations compartment since it is a property…

Each object (Bullet, Invader, Ship) moves at it’s own rate, so I put ‘Speed’ into an interface. All objects inherit from super class Sprite, and only override the Update() method. The Bullet abstract class does nothing with the Update method it got from Sprite, it’s just there to show that it got it from there. I do not know if this is the correct way, or that I should leave it out and only show it in the classes that override it?

Another problem that I do not know how to handle is the animation that is done by the invaders. I got the following properties: SheetSize, FrameSize, and CurrentFrame. Sheet contains the alien pictures (like a flip book), FrameSize is for selecting just on frame on the sheet, and CurrentFrame… well, holds the current frame. Since Ship and Bullet do not animate, these properties are not usefull for them. Where to put them?

Finally, I didn’t where to implement IBulletBehavior. First I had each bullet behavior implement IBulletBehavior, but switched to letting the abstract Bullet class implement it. Is there any rule that says which one to take?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T05:08:43+00:00Added an answer on May 20, 2026 at 5:08 am

    Abstract classes describe what a class is. You do not have to implement the actual functionality of the method calls, so don’t feel like you have to implement everything about a bullet in your Bullet class. Also, interfaces are great for describing what you class is capable of. Abstract classes show what something is (Is-A) and interfaces describe what the class can do.

    (I don’t know if this is just a class/interface exercise or if you are actually making a game. If it is just an exercise, you can skip to the next paragraph). For your SomeInterFace interface, how about something like IMoveable or IMobile? In here you can also look at mathematical vectors. The interface should not expose Speed, unless you want objects outside of the one implementing it to interact with Speed. Instead, it should be something along the lines of Move () and/or DetectCollision (). External interactions go in the interface–you’re telling the world what you can do.

    Finally, what is IBulletBehavior and why should a sprite care if it is one? This comes back to describing what you class can do. A bullet is a sprite but implements IBulletBehavior (whatever that is). Do you want all sprites to implement IBulletBehavior? What happens when you want a rock or something to just sit in the players way? You will now have an object that doesn’t implement the specified behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I posted a question not to long ago about how my program was essentially
I posted a similar question to this not too long ago in regards to
Not long ago I posted a question about a design decision of my F1
I had this problem a long time ago and recently I got some clues
I already posted a question about this ( Abandoned instances that will not continue
[I just posted a similar question, but I'm not sure whether is actually got
I've already posted this in the Fluent NH group a long time ago, but
I'm helping someone diagnose some slowness with their RoR applications. I'm not that deep
UPDATE: I did not realise that Thomas Levesque had posted a solution and worked
I posted a question next() not working and gota reply which is working fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.