Tag Info

Hot answers tagged

3

I think the Observer Pattern may fit here. Instead of sending a message to your button, let your button observe some component.


2

Disclaimer: artemis-odb dev here. -Changing the Entity System, i know of Artemis, but it would be great if you could point me at something else for Java if you know a library that does it better. I'm not sure whether you're referring to vanilla artemis or artemis-odb, but the latter improves on performance considerably with regards to mutating ...


1

Generalizing your problem, you have a pool of data (the player's state), and you need a way to represent a boolean expression over such data, Before starting, you may want to sit down and decide: How many situations need prerequisites? 20? 10000? Which data sources are available for querying? Just technologies and resources? How about time since the game ...


1

If you're looking for some magic pattern or data structure that deals with prerequisites, I don't think there is one, or rather, it's very simple: all you need is a simple way to query the number of Xs in Y, and a clear hierarchy of ownership. That is, be able to query things like: Number of buildings of a certain type in a city Whether a specific ...


1

So, i figured out how to do it quick and dirty, i subclassed Array (libGDX.util) to allow for faster removal of Entities and then i swapped it with the normal Array inside the Engine class of Ashley: package de.vatterger.threadedSim.tools; import com.badlogic.ashley.core.Entity; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.ObjectMap; ...


1

The game layer probably shouldn't know about the HUD layer. The HUD layer should maybe listen to events from the game layer. Your example is a bit vague, so let's say there is a button above each enemy that should have the lifetime of the enemy. You could make a button system that checks that the corresponding enemy(a component of the button) is still ...



Only top voted, non community-wiki answers of a minimum length are eligible