-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ add hound lamp freeze functionality #19
base: master
Are you sure you want to change the base?
Conversation
import de.bitbrain.braingdx.context.GameContext2D; | ||
import de.bitbrain.braingdx.tmx.TiledMapContext; | ||
import de.bitbrain.braingdx.world.GameObject; | ||
|
||
public class LevelStageBootstrap implements LevelBootstrap { | ||
|
||
CircuitModelMap circuitModelMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this private
|
||
// TODO: inject a lookup map to find circuit by game object | ||
// TODO: introduce object to model stereotype Map<GameObject, Model> which can be added to the context | ||
// Map<Model.class,Map<GameObject, Model>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very interesting idea. We might wanna add this to braingdx if it fulfills these criterias:
- it saves a lot of time when creating new games
- it does not introduce strange coupling at scale (checkout https://github.com/bitbrain/galacticum as a reference, this is a project of mine where I attempted to create an infinite 2D space game but it failed due to coupling issues. I want to avoid them in braingdx)
Let's see some code in action and see if it's useful!
if(circuit.getState() == Circuit.State.ON){ | ||
double xSep = hound.getLeft() - object.getLeft(); | ||
double ySep = hound.getTop() - object.getTop(); | ||
double rSep = Math.pow(Math.pow(xSep, 2) + Math.pow(ySep, 2), 0.5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you actually don't need that. Checkout the RayHandler class available through the LightingManager. I'd prefer this since we then can use different types of lights (like cone light for example)
needs tidying