Compare commits

..

No commits in common. "afb8d6d1e62a850fee70c4fd31a3660817f3d497" and "12700cb4e8caaf296c4fc0fbdd675c557688d8df" have entirely different histories.

2 changed files with 6 additions and 9 deletions

View File

@ -288,14 +288,11 @@ 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. _Using `:SetShader` will not work._ Afterwards, call `SetShader` on your actor. **Use `__raw` on the shader, else it'll pass in the proxy object and break!!!**
```lua ```lua
function uranium.init() function uranium.init()
setShader(actor, shader) sprite:SetShader(shader.__raw)
-- or
setShaderfuck(shader)
-- (don't forget to clearShaderfuck())
end end
``` ```
@ -1094,7 +1091,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 = 123 local GRAVITY = 2.3
local PLAYER_SIZE = 50 local PLAYER_SIZE = 50
local groundY = sh * 0.8 local groundY = sh * 0.8
@ -1132,7 +1129,7 @@ function uranium.update(dt)
end end
-- apply gravity -- apply gravity
vel.y = vel.y + GRAVITY * dt vel.y = vel.y + GRAVITY
-- update position, apply damping to velocity -- update position, apply damping to velocity
pos = pos + vel pos = pos + vel
@ -1274,7 +1271,7 @@ shader:uniform1f('yo', 1)
shader:uniform1f('scale', 0.25) shader:uniform1f('scale', 0.25)
function uranium.init() function uranium.init()
setShader(sprite, shader) sprite:SetShader(shader.__raw) -- important!!!! we need __raw, else it'll pass in the proxy and error silently
end end
function uranium.update() function uranium.update()

@ -1 +1 @@
Subproject commit 92aa7f33b3875db4bf68ce46a9ff432e7a94fdd1 Subproject commit 12edf6cb9a6cf4bad6a896566350bbb094d80cce