This file contains hidden or 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
pub trait GameState { | |
fn init(&mut self); | |
fn update(&mut self, delta: f32); | |
} | |
struct IngameState { | |
save: SaveDataStruct, | |
current_map: TodoMap, | |
entities: Vec<EntityStructOrTrait> | |
} |
This file contains hidden or 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
/* | |
* Copyright (c) 2014 Felix Kaaman | |
* | |
* This software is provided 'as-is', without any express or implied | |
* warranty. In no event will the authors be held liable for any damages | |
* arising from the use of this software. | |
* | |
* Permission is granted to anyone to use this software for any purpose, | |
* including commercial applications, and to alter it and redistribute it | |
* freely, subject to the following restrictions: |
This file contains hidden or 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
#include "game.h" | |
Chunk::Chunk(int x, int y, int z) { | |
memset(contents, 0, sizeof(contents)); | |
count = 0; | |
dirty = true; | |
left = 0; | |
right = 0; | |
top = 0; |
This file contains hidden or 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
void try_call_argv(const char* fn, int argc, ...) { | |
mrb_value argv[argc]; | |
va_list ap; | |
va_start(ap, argc); | |
for (i = 0; i < argc; i++) { | |
argv[i] = va_arg(ap, mrb_value); | |
} | |
va_end(ap); | |
if (fnlookup.count(fn)) { |
This file contains hidden or 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
apply plugin: 'java' | |
sourceCompatibility = 1.5 | |
version = '1.0' | |
repositories { | |
mavenCentral() | |
} | |
dependencies { |
This file contains hidden or 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
package cojo.game.tile; | |
import cojo.game.render.RenderUtils; | |
public class TileImpl extends Tile { | |
private String image; | |
private TiledLayerObject layer; | |
This file contains hidden or 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
package cojo.game.render; | |
import static org.lwjgl.opengl.GL11.*; | |
import org.newdawn.slick.opengl.TextureLoader; | |
import org.newdawn.slick.util.ResourceLoader; | |
import cojo.game.CojoGame; | |
public class RenderUtils { |
This file contains hidden or 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
#include "ruble.h" | |
Ruble::Ruble(GLFWwindow* wnd) : m_window(wnd) { | |
glfwMakeContextCurrent(m_window); | |
glMatrixMode(GL_PROJECTION); | |
glLoadIdentity(); | |
glOrtho(0, 640, 480, 0, -1, 1); | |
glEnable(GL_BLEND); |
This file contains hidden or 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 hidden or 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
require 'kaffeh' | |
class SomeGame < Game | |
def initialize(config) | |
cfg = Config.new(config) | |
Window.set_size cfg.get?('width', 320), cfg.get?('height', 240) | |
Window.set_title cfg.get?('title', 'Kaffeh!') | |
cfg.save |