Skip to content

Instantly share code, notes, and snippets.

View DCubix's full-sized avatar
💭
😄

Diego Lopes DCubix

💭
😄
View GitHub Profile
@DCubix
DCubix / gledit.py
Created February 19, 2016 04:47
Real-Time GLSL Editor for BGE
try:
from Tkinter import *
from ttk import *
import ScrolledText as scrolledtext
import tkMessageBox as msgbox
import tkFileDialog as filedlg
except ImportError:
from tkinter import *
from tkinter.ttk import *
from tkinter import scrolledtext
@DCubix
DCubix / gledit.py
Created February 19, 2016 14:52
Realtime GLSL Editor for BGE
try:
from Tkinter import *
from ttk import *
import ScrolledText as scrolledtext
import tkMessageBox as msgbox
import tkFileDialog as filedlg
except ImportError:
from tkinter import *
from tkinter.ttk import *
from tkinter import scrolledtext
package;
import cpp.Lib;
import sys.FileSystem;
import sys.io.File;
import com.sgtek.sengine.core.Game;
import com.sgtek.sengine.core.ResourceLoader;
GLGraphics 640, 480
glewInit()
Local verts : Float[] = [-1.0, -1.0, 0.0, 1.0, -1.0, 0.0, 0.0, 1.0, 0.0]
Local vao : Int
Local vbo : Int
glGenVertexArrays(1, Varptr(vao))
package com.genesis2d.tests;
import com.genesis2d.core.BaseGame;
import com.genesis2d.core.Engine;
import com.genesis2d.core.Resources;
import com.genesis2d.graphics.Light;
import com.genesis2d.graphics.SpriteBatch;
import com.genesis2d.graphics.Texture;
import com.genesis2d.logic.Entity;
import com.genesis2d.logic.Sprite;
function SimpleAnimation() {
pix.Component.apply(this);
this.t = 0;
};
SimpleAnimation.prototype = new pix.Component();
SimpleAnimation.prototype.update = function(dt) {
this.t += dt;
if (this.t >= Math.PI * 2) {
this.t = 0;
}
@DCubix
DCubix / concept.glsl
Last active August 21, 2016 15:08
Custom material shader concept for BGE
// Generated code. Not visible.
uniform struct TextureSlot {
vec2 offset;
vec2 scale;
float intensity;
float lodBias;
bool isNormalMap;
int blendMode; // Mix, Add, Subtract, Overlay, ...
int type; // Reflection, Refraction, Normal, UV, Generated.... This will determine which UV mapping algorithm to use.
/// and much more...
@DCubix
DCubix / Test.java
Created September 6, 2016 15:37
LKGE Demo
package logikers.lkge.test;
import logikers.lkge.components.SpriteRenderer;
import logikers.lkge.core.*;
import logikers.lkge.scenegraph.Entity;
import logikers.lkge.scenegraph.Scene;
class Rotator extends Component {
public float speed = 2f;
@DCubix
DCubix / Test.java
Created September 16, 2016 01:54
Simple jumping box using LKGE
package logikers.lkge.test;
import logikers.lkge.components.*;
import logikers.lkge.core.*;
import logikers.lkge.math.Rect;
import logikers.lkge.math.Vector2;
import logikers.lkge.physics.Collision;
import logikers.lkge.physics.PhysicsType;
import logikers.lkge.physics.Polygon;
import logikers.lkge.scenegraph.Entity;
{
"styles": {
"dark": {
"skin": "//path/to/skin.png",
"font": "//path/to/font.ttf"
},
"light": {
"skin": "//path/to/skin.png",
"font": "//path/to/font.ttf"
}