World Class

I have been making a game but my mind has drawn a blank and i can't remember what to put in the world class.

Don't say google it because when i did it came up with questions about how to become world class programmers.

please i need to know what should be in it
That's entirely dependent on what your overall design is like, what features you want to have, etc. If you don't know what goes where, who will?
If you don't know what goes in a World, why have one in the first place?
I just want to know the basics of what a world class generally contains.

My game is a 2d platformer. I would prefer to leave out details
Last edited on
The things that are in the world and the things that define the world.
that practically encompasses everything in the game
Maybe. I don't know. Vague questions can only lead to vague answers.
I suppose a World would be for managing multiple Levels.
What kind of world? A world like in Mario games (World 1, World 2, ..., World 8, World S)? A world being the same thing as a level? A world like in Minecraft where there are multiple dimensions within the world? You need to be more specific.
Here's a great tip that will take you far:

Hack it until you get it right. You can then modify it later for elegance. No one cares if your code is ugly at first, if it works, that's what counts. Chances are no one is going to see it anyway.

Your code is worthless unless it does something.

Don't worry about wrapping everything in a class right away. Your class is useless if it's not used to it's fullest potential.

This answer is extremely dependent on your game's mechanics. You know them best. If a design doesn't work for you, then you ask your question on design here. For now, just focus on getting something on the screen. You don't need a class right now. In your process of hacking, you'll find out what works and what doesn't, then you'll know what goes inside your world class.

Hell, the project that I've made most progress on had code that looked like garbage. Was it pretty? No. Did it work? Yes. Maybe some day I'll go back to it and clean it up. The sad truth is that your players couldn't care less about the quality of your code; The only care if the gameplay is good. Don't beat yourself up over it.

So, to summarize this in two simple words: Hack it.
Last edited on
First off, there's two things you can do to wrap your mind around game design.


1.) Just keep trying your best, you get better and better on learning how to express yourself in code, and doing it in a good manner.

2.) Read lots of books. There are literally countless books out there that have priceless knowledge. These are books such as "Programming Game AI by Example", "GPU Gems", "Game Engine Architecture" that all have very valuable things to teach you.



Now, understand you aren't even being very specific on what your "world" is. Every game has its own requirements, and thus its own implementation . I am working a 2d openworld rpg, so the idea behind what should be in a world is pretty vast. It involves several sorts of objects, spatial partitioning, streaming resources etc.

We really can't give you the answer to a question we don't know.
mine is a 2d platformer puzzle game.

@LB
It will be mario style based off your examples
Thinking that you need a class before you even know what that class is is kind of backwards. As helios said... if you don't even know what's supposed to go in that class, how is anyone else?

And back to Lowest0ne's question: What makes you think you need a World class in the first place? If it isn't obvious to you what purpose it serves, then why are you hung up on it?



That said... in very basic terms... I would approach such a game like so. Again, this may or may not apply to your game... and it is in very oversimplified terms:

- Have an 'Object' or similar class which has information related to in-game objects (like enemies, players, item drops, etc -- anything the player interacts with)

- Have a 'Map' or similar class which contains the boundaries/walls/floors/etc that the objects will interact with.

- Try to keep the binding between these two classes minimal. I would usually have 'Map' not know anything about Object... but provide an interface that Object can use to interact with it. Each 'Object' would have a pointer to the Map they exist in.

- Have a 'Game' (or I guess a 'World'?) class to tie it all together. IE, it would own the Map object and the Object objects... would do the big picture logic, calling on each individual 'Object' to do their own logic.
Thank you for all your responses. I have figured out what i am going to do now.
Topic archived. No new replies allowed.