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
This importable building block is a basic enemy which chases the nearest player. The enemy uses the [Health](./health.mdx) behavior and if the player has one it will damage it.
3
+
This importable building block is a basic enemy which chases the nearest player. The enemy uses the
4
+
[Health](./health.mdx) behavior and if the player has one it will damage it.
5
5
6
6
## How to use
7
7
8
-
After importing this building block, simply drag the enemy into your project and hit play.
8
+
After importing this building block, simply drag the enemy into your project and hit play.
Copy file name to clipboardExpand all lines: docs/building-blocks/lighting.mdx
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,13 @@
7
7
8
8
This page shows how to create dynamic lighting effects in Dreamlab using raycasting and PIXI graphics.
9
9
10
-
There is no built-in lighting system in Dreamlab. Instead, you can create lighting effects by combining raycasting for line-of-sight calculations with PIXI graphics for rendering shadows and illuminated areas.
10
+
There is no built-in lighting system in Dreamlab. Instead, you can create lighting effects by combining raycasting for
11
+
line-of-sight calculations with PIXI graphics for rendering shadows and illuminated areas.
11
12
12
13
## Light Overlay Example
13
14
14
-
Here's an example implementation of a lighting system using the `LightOverlay` behavior, which creates a dynamic shadow overlay that responds to the cursor position and world geometry.
15
+
Here's an example implementation of a lighting system using the `LightOverlay` behavior, which creates a dynamic shadow
16
+
overlay that responds to the cursor position and world geometry.
15
17
16
18
```ts
17
19
import { Behavior, BehaviorDestroyed, Collider, RawPixi, value } from"@dreamlab/engine";
Copy file name to clipboardExpand all lines: docs/building-blocks/platformer-controller.mdx
+24-84Lines changed: 24 additions & 84 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,9 @@ title: Platform Player Controller
4
4
5
5
# Platform Player Controllers
6
6
7
-
These two example controllers give you everything from a simple jump-and-gravity player to a full-featured platformer with animation control and moving platform support.
8
-
This follows the [standard player spawning model](/guide/network-authority/#standard-player-spawning-model).
7
+
These two example controllers give you everything from a simple jump-and-gravity player to a full-featured platformer
8
+
with animation control and moving platform support. This follows the
9
+
[standard player spawning model](/guide/network-authority/#standard-player-spawning-model).
9
10
10
11
---
11
12
@@ -38,19 +39,13 @@ Move and jump with keyboard controls! Fully multiplayer!
const movement =newVector2(horizontalVelocity*deltaTime, this.#verticalVelocity*deltaTime);
107
99
108
100
if (!this.#controller.isGrounded) this.#verticalVelocity-=this.gravity*deltaTime;
109
101
110
102
this.entity.pos=this.entity.pos.add(movement);
111
103
}
112
104
}
113
-
114
105
```
115
106
116
107
---
@@ -149,12 +140,15 @@ This demo is multiplayer! Try opening another browser tab to this page!
149
140
:::
150
141
151
142
### Overview
152
-
A complete 2D character controller for platformer games.
153
-
Includes variable jump height, coyote time, head collision checks, and sticking to moving platforms.
154
143
155
-
It uses Dreamlab's built-in `CharacterController` for physics and `Rapier` raycasts for grounded detection, plus animation references for idle/run/jump/fall states.
144
+
A complete 2D character controller for platformer games. Includes variable jump height, coyote time, head collision
145
+
checks, and sticking to moving platforms.
146
+
147
+
It uses Dreamlab's built-in `CharacterController` for physics and `Rapier` raycasts for grounded detection, plus
148
+
animation references for idle/run/jump/fall states.
156
149
157
150
### Code
151
+
158
152
```typescript
159
153
// This follows the https://docs.dreamlab.gg/guide/network-authority/#standard-player-spawning-model
0 commit comments