You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Tutorials/Creating A Scene.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Lets create a simple scene where you can move around player.
13
13
- Create a file for your scene with your desired name ( I Prefer SceneExample )
14
14
-`import "Cube2D" for Scene`
15
15
- Create a class as following
16
+
16
17
```js
17
18
import"Cube2D" for Scene
18
19
@@ -23,12 +24,14 @@ class SceneExample is Scene {
23
24
}
24
25
}
25
26
```
27
+
26
28
As you see we are inheriting Scene from the Cube2D module for our usage. So first of all we need a constructer for our new `SceneExample` class which you can use like `SceneExample.new()` but since we are inheriting `Scene` class we can also call `Scene` classes methods so our class is ready to be used like `SceneExample.new().Run()`.
27
29
28
30
- You probably wanna draw something to screen so lets draw a simple rectangle to screen for example.
0 commit comments