Skip to content

Commit

Permalink
Merge MovingBlocks#493 from @NanjoW - normal/debug keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Cervator committed Apr 20, 2013
2 parents 434a739 + 3f6c28d commit c5f6c2c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ Debug Features
Only works when the F3 debug mode is enabled (and may come and go)

* [Arrow up/down] - Adjust the current time in small steps
* [Arrow left/right] - Adjust the current time in larger steps
* [R] - Debug render wire-frame
* [P] - Activate first-person player camera
* [O] - Activate animated spawning point camera
* [K] - Don't try this :-)
* [Double Space] - God mode (fly / no-clip)
* [F4] - Different debug metrics
* [F6] - Debug rendering enabled
* [F7] - Cycle debug rendering stage
* [F8] - Debug render chunk bounding boxes

Tools
--------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ public void onKeyDown(KeyDownEvent event, EntityRef entity) {
case Keyboard.KEY_K:
entity.send(new DamageEvent(9999, null));
break;

case Keyboard.KEY_P: //Placeholder
break;
case Keyboard.KEY_O: //Placeholder
break;
case Keyboard.KEY_F6:
config.getSystem().setDebugRenderingEnabled(!config.getSystem().isDebugRenderingEnabled());
event.consume();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,14 @@ public void onMouseY(MouseYAxisEvent event, EntityRef entity) {

@ReceiveEvent(components = {LocalPlayerComponent.class, CharacterMovementComponent.class})
public void onJump(JumpButton event, EntityRef entity) {
boolean debugEnabled = config.getSystem().isDebugEnabled();
if (event.getState() == ButtonState.DOWN) {
CharacterMovementComponent characterMovement = entity.getComponent(CharacterMovementComponent.class);
characterMovement.jump = true;
if (timer.getTimeInMs() - lastTimeSpacePressed < 200) {
if (debugEnabled) {
characterMovement.isGhosting = !characterMovement.isGhosting;
}
}
lastTimeSpacePressed = timer.getTimeInMs();
event.consume();
Expand Down

0 comments on commit c5f6c2c

Please sign in to comment.