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
//overrides all fonts | |
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,300,400,800,700); | |
html * { | |
font-family: "Open Sans", Helvetica, arial,sans-serif; | |
} | |
//code font for this text area | |
.ace_scroller{ | |
font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace; | |
} |
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
/** | |
* Several forum topics in the past have asked about how to implement | |
* a timer or delay without using an Appstate or Control or an extra | |
* thread, which may be overkill for simple purposes such as delaying | |
* input into an Analog Listener (say, holding down a button to increment | |
* an integer value). I use getTimeInSeconds() here because getTime() | |
* returns ticks, and so you get unexpected behaviour like the timer | |
* counting 9.8 -> 9.9 -> 1.0 -> 1.1 etc. | |
*/ |
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
class LittleLevelState implements Savable{ | |
private WorldNode littleWorld1; | |
private WorldNode littleWorld2; | |
public LittleLevelState(WorldNode littleWorld1, WorldNode littleWorld2) { | |
this.littleWorld1 = littleWorld1; | |
this.littleWorld2 = littleWorld2; | |
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
public class Main extends SimpleApplication { | |
public ArrayList<BaseEntity> entities = new ArrayList<BaseEntity>(); | |
public ArrayList<Spatial> blocks = new ArrayList<Spatial>(); | |
public Player player; | |
public static void main(String[] args) { | |
AppSettings settings= new AppSettings(true); | |
settings.setTitle("jMonkey Pong 3D"); |
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
public static float[] RGBToOpenGL(int r1, int g1, int b1) { | |
float[] tmp = new float[3]; | |
tmp[0] = r1/255f; | |
tmp[1] = g1/255f; | |
tmp[2] = b1/255f; | |
return tmp; | |
} | |
public static float[] RGBAToOpenGL(int r1, int g1, int b1, int a1) { | |
float[] tmp = new float[4]; | |
tmp[0] = r1/255f; |
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
public class WorldNode extends Node { | |
@Override | |
public void read(JmeImporter e) throws IOException { | |
super.read(e); | |
InputCapsule capsule=e.getCapsule(this); | |
enemies=(Node) capsule.readSavable("Enemies", new Node()); | |
staticObjects=(Node) capsule.readSavable("StaticObjects", new Node()); | |
powerUps=(Node) capsule.readSavable("PowerUps", new Node()); | |
sky=(Geometry) capsule.readSavable("Sky", new Geometry()); |
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
public class Main extends SimpleApplication { | |
static final float START_Y = 150f ; | |
public static void main(String[] args) { | |
Main app = new Main(); | |
app.start(); | |
} | |
@Override | |
public void simpleInitApp() { |
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
public class MySimpleApplication extends SimpleApplication{ | |
private static MySimpleApplication staticApplication; | |
public MySimpleApplication(){ | |
staticApplication = this; | |
} | |
public static MySimpleApplication getApplication(){ | |
return staticApplication; | |
} |
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
Node model=(Node)assetManager.loadModel("Models/myModel.j3o"); | |
Geometry geom=(Geometry)model.getChild("myGeometry"); | |
geom.setMaterial(myMaterial); |
OlderNewer