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

Feature/domino #79

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open

Feature/domino #79

wants to merge 21 commits into from

Conversation

Ln11211
Copy link

@Ln11211 Ln11211 commented Jan 12, 2022

This PR closes issue 18 of LightAndShadow. Merging this PR solves the following tasks

  • make dice texture a texture atlas
  • create a basic domino block template
  • create domino blocks (one for each possible value of a domino half)
  • create domino prefabs
  • Make domino fall momentarily when hit

Ln11211 and others added 14 commits January 10, 2022 21:05
1)Added dice faces to the items.png.
2)Added a blank dice face for domino.
1) Added dice faces to items.atlas
     "one" represents the face with one dot and "two" with two dots and so on ...until six dots.
     "zero" represents the face with zero dots which will be used to make domino blocks.
2) Found a Typo in line 10, changed the "spaceTop" to "spadeTop" .
Found a Typo in line 10, changed the "spaceTop" to "spadeTop" .
As suggested, the dice face names have been changed. Added the prefix dice to the dice face names.
Created the domino block template. This block has all its properties derived from card.block template.
Created domino blocks (one for each possible value of a domino half).
There are 7 such domino blocks which are based on the template "domino" of LASR.
Added WhiteDice assets to blockTiles and also changed the individual domino block properties .
Fixed JSON syntax in domino block files and named the blocks..
1) removed the trailing commas.
2) Added missing comma.
Added a domino prefab(Not sure if it works).
Added prefabs for remaining domino blocks.
Added the logic for a domino to fall when hit and rise when hit.
Tried fixing an error in line 131
1)Fixed some refactoring issues in DominoComponent.java
2)In the DominoSystem.java, fixed a component typo
In line 185 of DominoSystem.java
The removed code is
for rise
        if (domino.riseSound != null) {
            entity.send(new PlaySoundEvent(domino.riseSound, 1f));
        }

for fall
        if (domino.fallSound != null) {
            entity.send(new PlaySoundEvent(domino.fallSound, 1f));
        }
This commits adds DominoRegion prefab
Just a small update
Removed DominoTop.block and DominoBottom.block block definitions as they are crashing the game.
@jdrueckert
Copy link
Member

Without having had time to dig too much into detail yet, there's one thing I noticed: In DominoSystem you're expecting the DominoComponent for both the placeDomino method (when receiving ActivateEvent) and the onFrob (btw what's "frob"?) method (also when receiving ActivateEvent).

However, as far as I've seen, you've never added a DominoComponent to a prefab, did you? - Don't get me wrong, from what we've discussed in the past, this is correct, because we cannot specify which exact domino top and bottom to use in the prefabs. However, this means, that you cannot expect the component when receiving an event on an entity, because that entity will not have that component. And if it does not have the component you're expecting, the method will not be executed.

I hope to find time for a more detailed test and review on Tuesday (my evening).

- add domino item and item texture
- remove unnecessary "domino<Digit>" and "domino<Digit>Block" prefabs
- harden against DominoComponent not present in region prefab
- add DominoComponent to region prefab (not 100% sure we need this)
- add logic to randomly pick upper and lower domino halves when placing a domino
@jdrueckert
Copy link
Member

With this commit, you should be able to place dominoes manually by giving yourself domino items (give domino in in-game console) and placing them against a two-block high wall. The placed domino should have a randomly picked upper and lower half.

Try it out and look at the changes I did in the commit and please ask about anything that's unclear in how it works / why I did it that way.

I did not yet test / look into the domino interaction (making it fall, have it come up again after a timeout), but I hope to have time for it on Thursday.

@jdrueckert
Copy link
Member

So, had a look at the domino interaction:

  1. dominos currently act like doors and swing open instead of falling over
  2. when interacting with dominos, the tiles change to dominoZero - I guess this is due to my change setting the top and bottom half to dominoZero, this needs to be removed from the prefab and set correctly in DominoSystem to the randomly selected tiles (see my last commit).

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