new SimpleGame(renderer, scene, camera)
Describes a simple game "scene", with the basics.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
Grape2D.Renderer | The renderer of the scene. |
scene |
Grape2D.Scene | A scene with a map. |
camera |
Grape2D.Camera | A camera to look at the scene. |
- Source:
Members
-
<private> camera :Grape2D.Camera
-
Camera of the scene.
Type:
- Source:
-
<private> clock :Grape2D.utils.Clock
-
Clock to help updating at each frame.
Type:
- Source:
-
<private> raf :number
-
Request animation frame ID.
Type:
- number
- Source:
-
<private> renderer :Grape2D.Renderer
-
Renderer.
Type:
- Source:
-
<private> scene :Grape2D.Scene
-
Scene.
Type:
- Source:
Methods
-
animate()
-
- Source:
-
getCamera() → {Grape2D.Camera}
-
Gets the camera.
- Source:
Returns:
The camera- Type
- Grape2D.Camera
-
getClock() → {Grape2D.utils.Clock}
-
Gets the clock.
- Source:
Returns:
The clock.- Type
- Grape2D.utils.Clock
-
getRenderer() → {Grape2D.Renderer}
-
Gets the renderer.
- Source:
Returns:
The renderer.- Type
- Grape2D.Renderer
-
getScene() → {Grape2D.Scene}
-
Gets the scene.
- Source:
Returns:
The scene.- Type
- Grape2D.Scene
-
render()
-
- Source:
-
setup()
-
- Source:
-
start()
-
- Source:
-
stop()
-
- Source:
-
update()
-
- Source: