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
Player can move units #62
Conversation
…next cell to move to is and jump to that. When it is occupied, then stop moving.
…his fixes any odd behavior as in trying to move left-down instead of diagonally (which may fit, as opposed to left-down, because at the left you might have another unit... - which causes an exception to be thrown when moving onto that)
just added - "player can move only its own units" |
… unit does not end up half on a cell when turning around. (make sure unit stays on one cell!)
@@ -12,12 +14,18 @@ | |||
*/ | |||
public class Mouse { | |||
|
|||
private Player playerControlled; |
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.
playerControlled
sounds like a boolean value. I like the name controllingPlayer
better.
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.
done
When clicking on another unit - while a unit is already selected - doesn't change the select, but moves the selected unit instead. This seems counter-intuitive. Is that supposed to happen? |
I'm noticing a z-index issue with the unit selection box: when a unit is selected and it drives diagonally past another unit, then the selection box is draw underneath the other unit. This seems logical: we draw the unit and the selection box in one pass, but they should probably be separate. Either we need to draw selection boxes after all units are rendered, or we need to change the draw order of units so it draws selected units last. I prefer the 1st option. Should we move this into another issue? |
@Override | ||
public void update(float deltaInMs) { | ||
this.fadingSelection.update(deltaInMs); | ||
if (shouldBeSomewhereElse()) { |
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.
Lol, I really like this method name 😄
@arjenvanderende created #65 |
…y are now disabled! :(
showing off the refactored mouse states at -> https://www.youtube.com/watch?v=IcIq43m31sE the only thing you can 'see' is that the mouse no longer snaps to the grid and that you can see what unit/structure is being placed. |
…e class (state) which saves us a lot of moving into constructors and makes it also accessible to the outside world.
Went a bit out of scope, but hey its fun! see: https://www.youtube.com/watch?v=tfRu9bwIoVQ&feature=youtu.be |
'self' (you cannot collide with yourself)
Bug is fixed! |
…-units Player can move units
After watching DHH's talk (https://www.youtube.com/watch?v=9LfmrkyP81M) - I think we should move forward (value) and write tests later. As in, it is a waste to keep this PR open (it is the only active branch, so can be master as well). |
Fixes #38
demo at: https://www.youtube.com/watch?v=lJy1o8QYEhg&feature=youtu.be
After review:
Mouse
class instead of having booleans. (ie, replace procedural polymorphism with inheritance) (demo at: https://www.youtube.com/watch?v=IcIq43m31sE)Mouse
moveSpeed
configurable forunit
instead of randomized in constructor