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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:38:41+00:00 2026-05-26T15:38:41+00:00

When I was younger, I used a tool called Game Maker a lot. I

  • 0

When I was younger, I used a tool called Game Maker a lot. I started to learn to program from it. I’m far beyond that now, but looking back on it, some of it’s features and designs are quite interesting. I’m wondering- How would I implement functionality similar to this tool using C++?
I’m wondering about:

  • Objects/classes

Game Maker had a list of ‘Objects’ that you would create which were essentially just different classes all derived from the same base class (I’ll call it GameObject for now) amd a system function called ‘instance_create’ that would take an object type as a paramater.
In c++ this would look something like this (Though syntatically very incorrect):

class MyGameObject : GameObject
{
    //...
}
GameObject instance_create(class objecttype)
{
    objecttype newinstance = new objecttype();
    return newinstance
}
GameObject* gameobjectinstance = instance_create(MyGameObject);

How would I go about implementing that?

  • system variables/functions

Game Maker had system variables and functions that could be accessed from anywhere. Period. Anywhere. I’m thinking globals, but I know that’s bad design. I’m thinking Having a global class, and have the variables/functions as static, but then they cannot be altered. How would I do that?

  • var

Game Maker had only one data type- a var. It could be a string, an integer, a decimal, anything. And there were system functions for conversion between those.

Lastly, how could I define the object types in some kind of script? Like, if I want to add a new type of object, create a new script? I don’t think C++ can create object types at runtime, so how would I do this?

  • 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-26T15:38:41+00:00Added an answer on May 26, 2026 at 3:38 pm

    Using a template.

    template<typename T> GameObject* instance_create()
    {
        return new T;
    }
    GameObject* gameobjectinstance = instance_create<MyGameObject>();
    

    However, the design you have specified is highly questionable (at best) and definitely not suited to C++. You should strive to implement a well-designed system, and one appropriate to the language, not re-create a system from the past.

    I especially think that since you mention run-time interpretation of scripts, that in fact the GameMaker classes and C++ classes have nothing to do with each other. And you definitely cannot create C++ classes at run-time, nor can you pass types around at run-time, nor can you instantiate templates at run-time.

    You would be best suited simply whipping out a scripting language, such as Lua, and writing only the necessary high-performance components in C++.

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

Sidebar

Related Questions

I'm writing a program that contains a generational garbage collector. There are just two
I would like to create a C# WPF form that collects measurements of equipment,
I was teaching C to my younger brother studying engineering. I was explaining him
Part of why I love Rails is that I hate SQL - I think
I want to select a row only if it is younger than a set
I have a DIV that is relatively positioned. The whole DIV needs to link
I'm considering Prestashop for a new project. It seems to be younger than Zen-Cart
I'm pretty new to programming in general and I'm creating a small game for
Allen Holub wrote the following, You can't have a program without some coupling. Nonetheless,
As a younger programmer, I'm always trying to look for applications of my skills.

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.