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

  • Home
  • SEARCH
  • 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 4116714
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:44:34+00:00 2026-05-20T22:44:34+00:00

So I am in the process of trying to learn how to develop 2D

  • 0

So I am in the process of trying to learn how to develop 2D games.

I am playing around with both Android and C#.

The issue that I am having is this.

It is easy enough to draw a sprite of some sort. Where I struggle is to visualize how one can code interactions of various objects on screen.

For example lets say I have the following Object.

public class MyGenericObject {
    public MyGenericObject() {}
    public Int32 Width { get; set; }
    public Int32 Height { get; set; }
    public Int32 X { get; set; }
    public Int32 Y { get; set; }
    public Image ObjectImage { get; set; }
}

Lets say I want to model the behavior of an interaction between N number of these Objects. What is a typical pattern one would utilize in such a scenario?

So for example would you simply call a method such as MyPhysicsSim.DoPhysics(List<MyGenericObjects>);

Assuming this is not a huge stretch. Inside of this method then, how do you calculate the interactions and resulting movements? I just can’t get my head around it (Obviously I do understand that there are basic equations that can solve direction and speed and so forth but I just can’t seem to work out how to apply these as an algorithm).

I have looked at numerous tutorials and all of them seem to concentrate on just drawing an object or assume a level of understanding about the internals that is way over my head. So I am hoping for a really simple, dumbed down response.

So basically what I am asking is how do you approach interactions between 2D objects in a OO paradigm for dummies?

  • 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-20T22:44:35+00:00Added an answer on May 20, 2026 at 10:44 pm

    Traditionally, most games have a loop similar to the one below somewhere at the core:

    while (1) {
        World.respondToInput();
        World.updatePhysics();
        World.renderScene();
        Timer.waitUntilFrameExpires();
    }
    

    and the ‘updatePhysics()’ method can do something very basic, such as:

    for (Object obj1 in World.trackedObjects()) {
        for (Object obj2 in World.trackedObjects()) {
            if (obj1.influences(obj2)) {
                obj1.update(); obj2.update();
            }
        }
    }
    

    So you basically have a ‘tick’ in the world you’re simulating, and your code works to reflect the delta in the scene that would have occurred.

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

Sidebar

Related Questions

I am in the process of trying to get my head properly around CSS3
I'm in the process of trying to 'learn more of' and 'learn lessons from'
I am trying to learn C++, in the process I tried to write a
I've been starting to learn hadoop, and currently I'm trying to process log files
I'm trying to learn how QProcess works and have this kind of code: #include
I'm trying to learn wpf and in the process I'm basically trying to load
I'm trying to learn a bit or 2 about process communication under Linux, so
I am trying to learn how to use BDD for our development process and
I'm trying to create more robust MySQL Queries and learn in the process. Currently
I'm in the process of trying to learn more about regular expressions and I've

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.