-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
641 additions
and
67 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sprite: res/barrier/electric_door.png | ||
fx_sprite: res/barrier/electric_door_emit.png | ||
scale_origin: [0.0, 0.0] | ||
animations: | ||
- name: "idle" | ||
loop: true | ||
frames: | ||
- clip: [0, 0, 20, 20] | ||
duration: 1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sprite: res/deco/light1.png | ||
fx_sprite: res/deco/light1_emit.png | ||
scale_origin: [0.0, 0.0] | ||
animations: | ||
- name: "idle" | ||
loop: true | ||
frames: | ||
- clip: [0, 0, 60, 100] | ||
duration: 1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
seed: 1234 | ||
|
||
images: | ||
- res/level2/map.png | ||
- res/level2/map_ent.png | ||
|
||
tiles: | ||
- class: ground | ||
texture: res/level1/ground.png | ||
noise: 1.0 | ||
color: [0, 0, 0] | ||
|
||
- class: ground | ||
texture: res/level1/wood.png | ||
noise: 0.0 | ||
color: [101, 101, 101] | ||
|
||
- class: ground | ||
texture: res/level1/sand.png | ||
noise: 3.0 | ||
color: [200, 200, 200] | ||
|
||
- class: B@back | ||
texture: res/level1/back.png | ||
noise: 1.0 | ||
color: [240, 240, 240] | ||
|
||
- class: B@backwood | ||
texture: res/level1/wood_back.png | ||
noise: 0.0 | ||
color: [160, 160, 160] | ||
|
||
areas: | ||
- name: water | ||
color: [0, 0, 255] | ||
- name: break_wood | ||
color: [0, 255, 150] | ||
- name: gate | ||
color: [100, 255, 150] | ||
- name: kill | ||
color: [255, 0, 0] | ||
|
||
points: | ||
- name: rock | ||
color: [140, 140, 200] | ||
|
||
- name: magmarock | ||
color: [140, 175, 200] | ||
|
||
- name: box | ||
color: [255, 140, 200] | ||
|
||
- name: player | ||
color: [100, 255, 50] | ||
|
||
- name: rockman | ||
color: [255, 100, 50] | ||
|
||
- name: door | ||
color: [0, 51, 255] | ||
|
||
- name: button0 | ||
color: [255, 0, 255] | ||
|
||
- name: light1l | ||
color: [255, 190, 0] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
sprite: res/objects/box.png | ||
fx_sprite: none | ||
scale_origin: [30.0, 30.0] | ||
animations: | ||
- name: "idle" | ||
loop: true | ||
frames: | ||
- clip: [0, 0, 60, 60] | ||
duration: 1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
sprite: res/objects/button.png | ||
fx_sprite: res/objects/button_emit.png | ||
scale_origin: [20.0, 20.0] | ||
animations: | ||
- name: "off" | ||
loop: true | ||
frames: | ||
- clip: [0, 0, 40, 40] | ||
duration: 1.0 | ||
- name: "on" | ||
loop: true | ||
frames: | ||
- clip: [40, 0, 40, 40] | ||
duration: 1.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#version 330 | ||
layout(location = 0) out vec4 color; | ||
layout(location = 1) out vec4 effect; | ||
|
||
uniform vec4 tint; | ||
uniform vec4 fx_tint; | ||
|
||
void main() | ||
{ | ||
color = tint; | ||
effect = fx_tint; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#version 330 | ||
layout (location = 0) in vec3 aPos; | ||
|
||
uniform mat4 tform; | ||
uniform mat4 subtform; | ||
|
||
void main() | ||
{ | ||
gl_Position = tform * subtform * vec4(aPos.x, aPos.y, aPos.z, 1.0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import nimgl/opengl | ||
import glm | ||
import shader | ||
|
||
# Draws a connected line, with width | ||
type Line* = ref object | ||
vbo: GLuint | ||
vao: GLuint | ||
width*: float | ||
shader*: Shader | ||
position*: Vec2f | ||
rotation*: float | ||
scale*: Vec2f | ||
points: int | ||
layer*: int | ||
|
||
color*: Vec4f | ||
fx_color*: Vec4f | ||
|
||
proc create_line*(points: seq[Vec2f], width: float = 1.0): Line = | ||
let shader = load_shader("res/shader/line") | ||
var verts: seq[float32] | ||
for point in points: | ||
verts.add(point.x) | ||
verts.add(point.y) | ||
verts.add(0.0) | ||
|
||
var vao: GLuint | ||
var vbo: GLuint | ||
glGenVertexArrays(1, addr vao) | ||
glGenBuffers(1, addr vbo) | ||
|
||
glBindVertexArray(vao) | ||
|
||
glBindBuffer(GL_ARRAY_BUFFER, vbo) | ||
glBufferData(GL_ARRAY_BUFFER, verts.len * sizeof(float32), unsafeAddr verts[0], GL_STATIC_DRAW) | ||
|
||
# position attribute | ||
glVertexAttribPointer(0'u32, 3'i32, EGL_FLOAT, false, 3 * float32.sizeof, cast[pointer](0)) | ||
glEnableVertexAttribArray(0) | ||
|
||
return Line(width: width, shader: shader, vbo: vbo, points: points.len, | ||
fx_color: vec4f(0, 0, 0, 0), color: vec4f(1, 1, 1, 1), vao: vao, scale: vec2f(1.0, 1.0)) | ||
|
||
proc do_draw*(line: Line) = | ||
var subtform = mat4f(1.0) | ||
subtform = subtform.rotate(line.rotation, 0, 0, 1).scale(line.scale.x, line.scale.y, 1.0) | ||
line.shader.set_mat4("subtform", subtform) | ||
line.shader.set_vec4("tint", line.color) | ||
line.shader.set_vec4("fx_tint", line.fx_color) | ||
|
||
glLineWidth(1.0) | ||
glBindVertexArray(line.vao) | ||
glDrawArrays(GL_LINE_STRIP, 0.GLint, line.points.GLsizei) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.