Skip to content
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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

punchcafe
Copy link
Collaborator

needs tidying

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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;
Copy link
Owner

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>>
Copy link
Owner

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);
Copy link
Owner

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants