mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 14:58:39 +00:00
deps: Refactor dependencies (#3224)
* remove spring dep move junit, logging, mockito under dep mgmt * upgrade anti-corruption-layer deps * async method invocation * balking, bloc * bridge to bytecode * caching * callback - cqrs * component - health check * hexagonal - metadata mapping * rest of the patterns * remove checkstyle, take spotless into use
This commit is contained in:
@@ -25,12 +25,11 @@
|
||||
package com.iluwatar.gameloop;
|
||||
|
||||
/**
|
||||
* Frame-based game loop is the easiest implementation. The loop always keeps spinning
|
||||
* for the following three processes: processInput, update and render. The problem with
|
||||
* it is you have no control over how fast the game runs. On a fast machine, that loop
|
||||
* will spin so fast users won’t be able to see what’s going on. On a slow machine, the
|
||||
* game will crawl. If you have a part of the game that’s content-heavy or does more AI
|
||||
* or physics, the game will actually play slower there.
|
||||
* Frame-based game loop is the easiest implementation. The loop always keeps spinning for the
|
||||
* following three processes: processInput, update and render. The problem with it is you have no
|
||||
* control over how fast the game runs. On a fast machine, that loop will spin so fast users won’t
|
||||
* be able to see what’s going on. On a slow machine, the game will crawl. If you have a part of the
|
||||
* game that’s content-heavy or does more AI or physics, the game will actually play slower there.
|
||||
*/
|
||||
public class FrameBasedGameLoop extends GameLoop {
|
||||
|
||||
@@ -44,11 +43,10 @@ public class FrameBasedGameLoop extends GameLoop {
|
||||
}
|
||||
|
||||
/**
|
||||
* Each time when update() is invoked, a new frame is created, and the bullet will be
|
||||
* moved 0.5f away from the current position.
|
||||
* Each time when update() is invoked, a new frame is created, and the bullet will be moved 0.5f
|
||||
* away from the current position.
|
||||
*/
|
||||
protected void update() {
|
||||
controller.moveBullet(0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user