Compare commits
2 Commits
12700cb4e8
...
afb8d6d1e6
Author | SHA1 | Date |
---|---|---|
Jill | afb8d6d1e6 | |
Jill | 88a4ebe180 |
13
MANUAL.md
13
MANUAL.md
|
@ -288,11 +288,14 @@ local sprite = Sprite('docs/uranium.png')
|
||||||
local shader = Shader('src/shader.frag') -- returns a RageShaderProgram
|
local shader = Shader('src/shader.frag') -- returns a RageShaderProgram
|
||||||
```
|
```
|
||||||
|
|
||||||
Afterwards, call `SetShader` on your actor. **Use `__raw` on the shader, else it'll pass in the proxy object and break!!!**
|
Afterwards, call `setShader` on your actor. _Using `:SetShader` will not work._
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
function uranium.init()
|
function uranium.init()
|
||||||
sprite:SetShader(shader.__raw)
|
setShader(actor, shader)
|
||||||
|
-- or
|
||||||
|
setShaderfuck(shader)
|
||||||
|
-- (don't forget to clearShaderfuck())
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1091,7 +1094,7 @@ local input = require('stdlib.input')
|
||||||
local DAMPING = 1/9500
|
local DAMPING = 1/9500
|
||||||
local SPEED = 2
|
local SPEED = 2
|
||||||
local JUMP_FORCE = 32
|
local JUMP_FORCE = 32
|
||||||
local GRAVITY = 2.3
|
local GRAVITY = 123
|
||||||
local PLAYER_SIZE = 50
|
local PLAYER_SIZE = 50
|
||||||
|
|
||||||
local groundY = sh * 0.8
|
local groundY = sh * 0.8
|
||||||
|
@ -1129,7 +1132,7 @@ function uranium.update(dt)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- apply gravity
|
-- apply gravity
|
||||||
vel.y = vel.y + GRAVITY
|
vel.y = vel.y + GRAVITY * dt
|
||||||
|
|
||||||
-- update position, apply damping to velocity
|
-- update position, apply damping to velocity
|
||||||
pos = pos + vel
|
pos = pos + vel
|
||||||
|
@ -1271,7 +1274,7 @@ shader:uniform1f('yo', 1)
|
||||||
shader:uniform1f('scale', 0.25)
|
shader:uniform1f('scale', 0.25)
|
||||||
|
|
||||||
function uranium.init()
|
function uranium.init()
|
||||||
sprite:SetShader(shader.__raw) -- important!!!! we need __raw, else it'll pass in the proxy and error silently
|
setShader(sprite, shader)
|
||||||
end
|
end
|
||||||
|
|
||||||
function uranium.update()
|
function uranium.update()
|
||||||
|
|
2
template
2
template
|
@ -1 +1 @@
|
||||||
Subproject commit 12edf6cb9a6cf4bad6a896566350bbb094d80cce
|
Subproject commit 92aa7f33b3875db4bf68ce46a9ff432e7a94fdd1
|
Loading…
Reference in New Issue