Created
August 4, 2016 05:12
-
-
Save DCubix/5551de16e7f00fba92adb66aa8a76045 to your computer and use it in GitHub Desktop.
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 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; | |
import com.genesis2d.math.Vec3; | |
/** | |
* | |
* @author TwisterGE | |
*/ | |
public class Test0 extends BaseGame { | |
SpriteBatch b; | |
Texture dif = null, nrm = null; | |
Entity en; | |
public Test0() { | |
super("Test0", 800, 600, false); | |
} | |
@Override | |
public void preload(Resources res) { | |
res.addTexture("castle_d", "res/castle_d.png"); | |
res.addTexture("castle_n", "res/castle_n.png"); | |
} | |
@Override | |
public void init() { | |
b = getEngine().getSpriteBatch(); | |
dif = Resources.instance().getTexture("castle_d"); | |
nrm = Resources.instance().getTexture("castle_n"); | |
en = getScene().createEntity(new Sprite(dif, nrm), -1); | |
Light L = new Light(new Vec3(400, 300, 1)); | |
L.setRadius(2f); | |
L.setIntensity(1f); | |
b.addLight(L); | |
} | |
public static void main(String[] args) { | |
Engine engine = new Engine(new Test0()); | |
new Thread(engine).start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment