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 8007769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:56:07+00:00 2026-06-04T17:56:07+00:00

I made two games so far, one was a simple 2D MMO, and another

  • 0

I made two games so far, one was a simple 2D MMO, and another one was a 2D portal clone with some more features.

Anyway, I noticed that my class design in those two games varied a bit:

In the MMO, I’d create a class called “Enemy”, and this class would take some arguments such as image and attack_power.

In the Portal-like game, I’d create classes for every kind of object specifically, for example “Box” or “Wall” or “Doors”. Then, these would take only position as an argument, and inside I’d flag them for movable, physics with true/false, and then I would have an update function which would act upon these objects.

What is the best approach to this kind of problem? How specific should I be, and should I use something completely different?

I made those games in Python and Javascript.

  • 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-06-04T17:56:08+00:00Added an answer on June 4, 2026 at 5:56 pm

    That depends on the purposes of each class, on the language which you’re using, on what you’re trying to achieve, the specific problems you’re trying to solve, and a zillion other factors – every problem and every program is different.

    I’d recommend doing some research around the SOLID prinicples of OO design, these principles are more like guidelines than rules, but understanding them and being able to apply them to a real problem might help you achieve ‘good’ class design – http://davesquared.net/2009/01/introduction-to-solid-principles-of-oo.html

    There is no “best” approach, since there are no universal right or wrong ways to solve a problem, and a perfect solution is not always possible or desirable when you factor in other real world issues which you might come across along the way.

    The kinds of questions you might think about asking yourself could be along the lines of

    • What does my program actually do? Often, the most useful classes emerge when you start to think about the way your program works. For example, your movable Box class may end up doing very little to the point where it’s easier to represent it as a simple struct, but you might find a use for a BoxMover class which is packed full of ‘move’ logic, and knows how to move Boxes around.

    • How do the different entities in my program behave? You don’t mention very many details about your classes, so only you would know whether they do different things, but if you end up with dozens of almost-identical classes (particularly where the differences are restricted to data) then you may have gone too far.

    • What do I actually want to do with the classes? Its important to think about interfaces; the focus of OO design is more about the way your classes are used than the data which your classes store. (e.g. contrary to popular belief, a Square may have absolutely nothing in common with a Rectangle). Likewise, a class which has nothing more than single-line get-set functions for its interface is probably not making your life any easier, or bringing you any closer to finding a good solution.

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

Sidebar

Related Questions

I have made two games for the iPhone already, the first one was a
I made two classes in which one is main and other one is a
I made two different Fibonacci functions, the first one worked perfectly. Then I tried
I've created a simple webapp with user authentication. I've made two models: Users for
I'm putting together a simple test made up of two tutorials available online for
I made a simple command-line based game in java, only two classes (using Eclipse).
i have made two view classes in first view class i am making more
I've got two tables, one with games and one with participants. A game can
I made a little Shooter game with two ships firing at each other. I
I have made two kernel modules for client and server which are transmitting the

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.