Skip to content

Commit

Permalink
committing all changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eppleton committed Jan 10, 2015
1 parent a9c7998 commit 5c76a8e
Show file tree
Hide file tree
Showing 9 changed files with 650 additions and 45 deletions.
31 changes: 31 additions & 0 deletions X.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/samplegames-bck2brwsr/pom.xml b/samplegames-bck2brwsr/pom.xml
index 7d88cec..cb7e1cb 100644
--- a/samplegames-bck2brwsr/pom.xml
+++ b/samplegames-bck2brwsr/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>de.eppleton.fx2d</groupId>
<artifactId>fxgameengine</artifactId>
- <version>0.7-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@@ -71,7 +71,7 @@
<dependency>
<artifactId>net.java.html.sound</artifactId>
<groupId>org.netbeans.html</groupId>
- <version>0.7.5</version>
+ <version>${net.java.html.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
@@ -86,7 +86,7 @@
<dependency>
<groupId>org.netbeans.html</groupId>
<artifactId>net.java.html.boot</artifactId>
- <version>1.0</version>
+ <version>${net.java.html.version}</version>
</dependency>

<dependency>
557 changes: 557 additions & 0 deletions demos/hello-world-physics/hs_err_pid4724.log

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions demos/hello-world-tileengine/nb-configuration.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ public Hero(Level field, TileSet base, String name, double x, double y, int widt
DOWN = new State(new TileSetAnimation(heroSet, new int[]{32}, 10f), "down");
RIGHT = new State(new TileSetAnimation(heroSet, new int[]{48}, 10f), "right");

moveUp = new MoveAction(new TileSetAnimation(heroSet, new int[]{1, 2, 3, 4, 5, 6, 7, 8}, 10f), "move up", 0, -2, UP);
moveLeft = new MoveAction(new TileSetAnimation(heroSet, new int[]{17, 18, 19, 20, 21, 22, 23, 24}, 10f), "move left", -2, 0, LEFT);
moveDown = new MoveAction(new TileSetAnimation(heroSet, new int[]{33, 34, 35, 36, 37, 38, 39, 40}, 10f), "move down", 0, 2, DOWN);
moveRight = new MoveAction(new TileSetAnimation(heroSet, new int[]{49, 50, 51, 52, 53, 54, 55, 56}, 10f), "move right", 2, 0, RIGHT);
moveUp = new MoveAction(new TileSetAnimation(heroSet, new int[]{1, 2, 3, 4, 5, 6, 7, 8}, 10f), "move up", 0, -1, UP);
moveLeft = new MoveAction(new TileSetAnimation(heroSet, new int[]{17, 18, 19, 20, 21, 22, 23, 24}, 10f), "move left", -1, 0, LEFT);
moveDown = new MoveAction(new TileSetAnimation(heroSet, new int[]{33, 34, 35, 36, 37, 38, 39, 40}, 10f), "move down", 0, 1, DOWN);
moveRight = new MoveAction(new TileSetAnimation(heroSet, new int[]{49, 50, 51, 52, 53, 54, 55, 56}, 10f), "move right", 1, 0, RIGHT);



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ public boolean perform(Sprite sprite) {
if (Math.abs(dx) < Math.abs(dy)) {
if (dy > 0) {
sprite.setVelocityX(0);
sprite.setVelocityY(1.5);
sprite.setVelocityY(.8);
sprite.setAnimation(monsterDown);
// sprite.setDirection(AnimatedSprite.Direction.SOUTH);
} else {
sprite.setVelocityX(0);
sprite.setVelocityY(-1.5);
sprite.setVelocityY(-.8);
sprite.setAnimation(monsterUp);

// sprite.setDirection(AnimatedSprite.Direction.NORTH);
}
} else {
if (dx > 0) {
sprite.setVelocityX(1.5);
sprite.setVelocityX(.8);
sprite.setVelocityY(0);
sprite.setAnimation(monsterRight);

// sprite.setDirection(AnimatedSprite.Direction.EAST);
} else {
sprite.setVelocityX(-1.5);
sprite.setVelocityX(-.8);
sprite.setVelocityY(0);
sprite.setAnimation(monsterLeft);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* For alternative licensing or use in closed source projects contact Anton
* Epple
* <info@eppleton.de>
*/package de.eppleton.fx2d.samples.spaceinvaders;
*/
package de.eppleton.fx2d.samples.spaceinvaders;

import de.eppleton.canvas.html.HTML5Graphics;
import de.eppleton.fx2d.beans.DoubleProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import de.eppleton.fx2d.timer.Handler;
import de.eppleton.fx2d.timer.spi.GameTimerEnvironment;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Logger;

/**
Expand Down Expand Up @@ -57,26 +55,16 @@ public static class BBTimer {
}

private void start() {
// running = true;
// while (running) {
//
//
// }
timer = new Timer();
timer.schedule(new TimerTask() {

timer = new Timer() {

@Override
public void run() {
Main.brwsrctx.execute(new Runnable() {

@Override
public void run() {
handler.pulse(System.nanoTime());
start();
}
});
handler.pulse(System.nanoTime());
timer.schedule(16);
}
},16);
};
timer.schedule(16);
}

private void stop() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package de.eppleton.fx2d.dukescript;

import net.java.html.js.JavaScriptBody;



public abstract class Timer implements Runnable {

Object jsTimer = null;

public void cancel() {
close(jsTimer);
jsTimer = null;
}

@Override
public abstract void run();

@JavaScriptBody(args = { "r", "millis" }, javacall = true, body =
"return window.setTimeout(function() { r.@java.lang.Runnable::run()(); }, millis);"
)
private static native Object schedule(Runnable r, int millis);

public void schedule(int millis) {
if (jsTimer != null) {
cancel();
}
jsTimer = schedule(this, millis);
}

@JavaScriptBody(args = { "timer" }, body =
"window.clearTimeout(timer);"
)
private static native void close(Object self);
}
11 changes: 11 additions & 0 deletions tileengine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
<artifactId>org.eclipse.persistence.moxy</artifactId>
<version>2.6.0-SNAPSHOT</version>
<type>jar</type>
<exclusions>
<exclusion>
<groupId>javax.json</groupId>
<artifactId>org.glassfish.javax.json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.json</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
<repositories>
Expand Down

0 comments on commit 5c76a8e

Please sign in to comment.