New answers tagged

0

I did create a few prototypes but nothing too big and the way I used to handle multiple spaces was simply create a game object which contains, world, player etc and than I'd setup some properties that are required by some other spaces for example health, in the game object Whenever called it will get the player's health. that way I could send it to the HUD ...


2

You should use option 1, which has 3 advantages: It's easier to instantiate a resource - instead of having to pass the type of the resource as a parameter, you would just do, for example, new Gold(50) If you need to give special behaviour to a resource, you can by changing it's class. It's easier to check if a resource is a certain type - resource ...


1

If your resources have no business logic of their own, or special case scenarios with how they interact with the environment, other resources (besides trade which you've covered) or the player then option two makes adding new ones very easy. If you need to consider situations like what would happen if you mix two resources for crafting, if the resources can ...


1

The concept of attacks and varying speeds would be implemented by a gameplay or engine programmer typically. The designer would be the one deciding if those concepts should exist and also on the particular values of each attack.


14

I would like to add there are two extra options: Interface: you can consider it if the resource class would be just a "storage" for 5 integers and each other entity would have different logic regarding resources (e.g. player spend/loot, city produces resource). In that case you might not want a class at all - you merely wanted to expose that some entity has ...


30

A rule of thumb is that you use different classes when objects require different code and instances of the same class when the objects only require different values. When the resources have different game mechanics which are unique to them, it might make sense to represent them with classes. For example, when you have Plutonium which has a half-life time ...


52

Go with the second approach, simply due to the fact that you can introduce new resource types or items at any time without having to rewrite or update code (data driven development). Edit: To elaborate a bit more on why this is in general good practice, even if you're 100% sure some value won't ever change. Let's take the console game example mentioned ...


0

I'm guessing your using plain Javascript with no engine. You could just hold off drawing your objects to the screen. If you put all of your game objects in a function then you could hold of rendering them until someone click continue. After that condition is met then the render of all your object can happen. There you go. A nice simple start menu. Was this ...


0

Of course you can but there are problems you wouldn't like to run through, different platforms has diferent architectures, different memory structure, different float point, different byte length, etc. So probably your code will not work as expected os simply, output different things in each platform. If you are working in a "high precision math" (anything ...


0

Is it possible? Yes, but it will be very difficult, from a programming standpoint, as has already been addressed. From a design standpoint, I cannot imagine a game that would be enjoyed by people on such varying devices. Most console and PC gamers play more action-y games than mobile games, and if your game is a multiplayer action game console and PC gamers ...


0

Is it possible? Yes. Is it a good idea? No, for various reasons that involve trying to balance the game for the many different input devices. As for the difficulties in actual development, most modern game engines are purpose built to be able to port the same game to PC, xbox, playstation, mobile devices, and macs without too much trouble aside from ...


0

The cost and time for creating the defective products needs to be added to the cost and time of sellable products. When x% of your products are defective, the cost and time of the sellable ones is multiplied by 100 / (100 - x). Example: 75% of your products are defective, so you need to pay for the production of four products (100 / 25) for each one you can ...


0

I encountered a similar problem while working on a project of mine. The player was able to pick up a certain variety of weapons, which shoot different type of bullets. I'll help you to figure out a solution for you by explaining the solution I found for my game. In order to take advantage of inheritance and polymorphism, I managed to work out all the ...



Top 50 recent answers are included