Skip to content

Commit 488d90a

Browse files
committed
Fixed Creating A Scene.md
1 parent bd6ac3e commit 488d90a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

docs/Tutorials/Creating A Scene.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Lets create a simple scene where you can move around player.
1313
- Create a file for your scene with your desired name ( I Prefer SceneExample )
1414
- `import "Cube2D" for Scene`
1515
- Create a class as following
16+
1617
```js
1718
import "Cube2D" for Scene
1819

@@ -23,12 +24,14 @@ class SceneExample is Scene {
2324
}
2425
}
2526
```
27+
2628
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()`.
2729

2830
- You probably wanna draw something to screen so lets draw a simple rectangle to screen for example.
2931
- Add `Draw() {}` method to your class.
3032
- `import "raylib" for COLOR`
3133
- also `import` `Rect` from `Cube2D`
34+
3235
```js
3336
import "Cube2D" for Scene, Rect
3437

0 commit comments

Comments
 (0)