-
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.
A whole lot of progress. Also add neccesary DLLs and fix chipmunA whole
lot of progress. Also add neccesary DLLs and fix chipmunkk
- Loading branch information
Showing
37 changed files
with
2,419 additions
and
138 deletions.
There are no files selected for viewing
Binary file not shown.
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
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.
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,35 @@ | ||
seed: 1234 | ||
tiles: | ||
- class: ground | ||
texture: res/level1/ground.png | ||
edge: [99, 78, 35] | ||
edge_width: 4 | ||
noise: 1.0 | ||
color: [101, 101, 0] | ||
|
||
- class: ground | ||
texture: res/level1/wood.png | ||
edge: [89, 50, 21] | ||
edge_width: 4 | ||
noise: 0.0 | ||
color: [101, 101, 101] | ||
|
||
areas: | ||
- name: water | ||
color: [0, 0, 255] | ||
|
||
points: | ||
- name: tree1 | ||
color: [200, 0, 255] | ||
|
||
- name: tree2 | ||
color: [255, 0, 255] | ||
|
||
- name: log_spawn | ||
color: [0, 255, 150] | ||
|
||
- name: box_spawn | ||
color: [0, 255, 200] | ||
|
||
- name: player_spawn | ||
color: [255, 0, -1] |
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.
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#version 330 | ||
layout(location = 0) out vec3 color; | ||
layout(location = 0) out vec4 color; | ||
layout(location = 1) out vec3 effect; | ||
|
||
in vec2 vTex; | ||
|
||
uniform sampler2D tex; | ||
uniform vec4 tint; | ||
|
||
void main() | ||
{ | ||
vec2 coord = vTex; | ||
|
||
coord = vec2(vTex.x, 1.0 - vTex.y); | ||
|
||
vec4 col = texture(tex, coord); | ||
|
||
color = col.xyz; | ||
color = texture(tex, coord) * 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
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,35 @@ | ||
# Very simple wrapper for the soloud engine so its more nim-like | ||
|
||
import system/io | ||
import solouddotnim | ||
|
||
var soloud : ptr Soloud | ||
|
||
type AudioHandle* = distinct int | ||
type WavHandle* = object | ||
wave: ptr Wav | ||
|
||
proc `=destroy`(x: var WavHandle) = | ||
if x.wave != nil: | ||
echo "Destroying sound " & repr x.wave | ||
Wav_destroy(x.wave) | ||
|
||
|
||
|
||
proc init_soloud*() = | ||
soloud = Soloud_create() | ||
discard Soloud_init(soloud) | ||
|
||
proc deinit_soloud*() = | ||
Soloud_deinit(soloud) | ||
Soloud_destroy(soloud) | ||
|
||
proc load_sound*(path: cstring): WavHandle = | ||
var wave = Wav_create() | ||
discard Wav_load(wave, path) | ||
return WavHandle(wave: wave) | ||
|
||
proc play_sound*(sound: WavHandle, loop: bool = false): AudioHandle = | ||
let handle = Soloud_play(soloud, sound.wave) | ||
Soloud_setLooping(soloud, handle, loop.int32) | ||
return cast[AudioHandle](handle) |
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 |
---|---|---|
@@ -1,63 +1,11 @@ | ||
import nimgl/[glfw, opengl] | ||
import os | ||
include base/renderer | ||
include base/scene_manager | ||
|
||
var should_quit* = false | ||
var renderer*: Renderer = nil | ||
var dt*: float32 | ||
|
||
var update_fnc*: proc() = nil | ||
var render_fnc*: proc() = nil | ||
var quit_fnc*: proc() = nil | ||
|
||
assert glfwInit() | ||
|
||
glfwWindowHint(GLFWContextVersionMajor, 3) | ||
glfwWindowHint(GLFWContextVersionMinor, 3) | ||
glfwWindowHint(GLFWOpenglForwardCompat, GLFW_TRUE) # Used for Mac | ||
glfwWindowHint(GLFWOpenglProfile, GLFW_OPENGL_CORE_PROFILE) | ||
glfwWindowHint(GLFWResizable, GLFW_FALSE) | ||
|
||
let glfw_window*: GLFWWindow = glfwCreateWindow(800, 600, "Minijam 110") | ||
if glfw_window == nil: | ||
quit(-1) | ||
|
||
glfw_window.makeContextCurrent() | ||
|
||
# Active V-sync, useful to avoid FPS being in the thousands! | ||
glfwSwapInterval(1) | ||
|
||
assert glInit() | ||
|
||
renderer = create_renderer("res/shader/fullscreen", 800, 600) | ||
|
||
proc launch_game*() = | ||
assert scene_stack.len > 0, "Remember to add a scene before starting the game" | ||
|
||
var last_time = glfwGetTime() | ||
|
||
# Launch the main loop | ||
while not should_quit: | ||
glfwPollEvents() | ||
|
||
update_fnc() | ||
scene_manager_update() | ||
|
||
glClearColor(0.0, 0.0, 0.0, 1.0) | ||
glClear(GL_COLOR_BUFFER_BIT) | ||
|
||
renderer.before_render() | ||
if render_fnc != nil: render_fnc() | ||
scene_manager_render(renderer) | ||
renderer.render() | ||
|
||
glfw_window.swapBuffers() | ||
var new_time = glfwGetTime() | ||
dt = new_time - last_time | ||
last_time = new_time | ||
|
||
if quit_fnc != nil: quit_fnc() | ||
|
||
glfw_window.destroyWindow() | ||
glfwTerminate() | ||
# include (not import) this file to have the base classes | ||
|
||
import launcher | ||
import base/scene_manager | ||
import graphics/sprite | ||
import graphics/camera | ||
import globals | ||
import base/renderer as rnd | ||
import audio/audio_engine | ||
import solouddotnim | ||
import glm |
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.