Player = 0,
EventListeners = {
MoveLeftPressed = function(self)
- self.Velocity.x = self.Velocity.x - 3
+ self.Velocity.x = self.Velocity.x - 3.0
self.Render.flipx = true;
end,
MoveLeftReleased = function(self)
- self.Velocity.x = self.Velocity.x + 3
+ self.Velocity.x = self.Velocity.x + 3.0
end,
MoveRightPressed = function(self)
- self.Velocity.x = self.Velocity.x + 3
+ self.Velocity.x = self.Velocity.x + 3.0
self.Render.flipx = false;
end,
MoveRightReleased = function(self)
- self.Velocity.x = self.Velocity.x - 3
+ self.Velocity.x = self.Velocity.x - 3.0
end,
JumpKeyPressed = function(self)
if self.Physics.standing == true then
--- /dev/null
+uniform sampler2D sampler;
+
+varying vec2 texCoord;
+varying vec4 color;
+
+void main(){
+ vec4 pixelColor = texture2D(sampler, vec2(texCoord.x, texCoord.y));
+ //TODO allow antialiasing
+ //if (pixelColor.w != 1.0f)
+ // discard;
+ gl_FragColor = pixelColor * color;
+}
--- /dev/null
+attribute vec3 coord2d;
+attribute vec2 tex_coord;
+
+uniform mat4 ortho;
+uniform vec4 tex_color;
+
+varying vec2 texCoord;
+varying vec4 color;
+
+void main(){
+ texCoord = tex_coord;
+ color = tex_color;
+ gl_Position = ortho * vec4(coord2d.xyz, 1.0);
+}