master
Marcus Gosselin 2016-02-23 23:10:48 -05:00
parent 5e1777bafc
commit d1bb727dd1
6 changed files with 54 additions and 17 deletions

View File

@ -11,7 +11,23 @@ End Component
Template player
#THE GROUND
[Entity]
$name = "Scene Manager"
Component SceneManager
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
$name = "Ground"
$x = 0i
$y = 550i
Component RectRenderer
$name = "render!"
$width = 1024i
$height = 50i
$color = #E91E63
End Component
Component RigidBody
$name = "poop"
$friction = 1f
End Component

View File

@ -1,21 +1,23 @@
[Entity]
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
$name = "Player"
$x = 504f
$y = 50f
Component spacewars.PlayerController
$name = "player controller"
$message = "hello from the script!"
$speed = .00000000001f
$speed = 1f
End Component
Component RectRenderer
$name = "render!"
$width = 16i
$height = 16i
$color = #FA05BB
$color = #e91e63
End Component
Component RigidBody
$name = "poop"
$friction = .9F
$dy = 5f
$friction = .9f
End Component

View File

@ -11,7 +11,23 @@ End Component
Template player
#THE GROUND
[Entity]
$name = "Scene Manager"
Component SceneManager
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
$name = "Ground"
$x = 0i
$y = 550i
Component RectRenderer
$name = "render!"
$width = 1024i
$height = 50i
$color = #E91E63
End Component
Component RigidBody
$name = "poop"
$friction = 1f
End Component

View File

@ -1,21 +1,23 @@
[Entity]
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
$name = "Player"
$x = 504f
$y = 50f
Component spacewars.PlayerController
$name = "player controller"
$message = "hello from the script!"
$speed = .00000000001f
$speed = 1f
End Component
Component RectRenderer
$name = "render!"
$width = 16i
$height = 16i
$color = #FA05BB
$color = #e91e63
End Component
Component RigidBody
$name = "poop"
$friction = .9F
$dy = 5f
$friction = .9f
End Component

View File

@ -25,13 +25,13 @@ public class PlayerController extends DiveScript implements KeyListener {
public void update() {
if(Input.getKeyDown(KeyEvent.VK_W))
rigidBody.dy += -1 * speed;
rigidBody.dy += -1 * speed * Time.deltaTime;
if(Input.getKeyDown(KeyEvent.VK_S))
rigidBody.dy += 1 * speed;
rigidBody.dy += 1 * speed * Time.deltaTime;
if(Input.getKeyDown(KeyEvent.VK_A))
rigidBody.dx += -1 * speed;
rigidBody.dx += -1 * speed * Time.deltaTime;
if(Input.getKeyDown(KeyEvent.VK_D))
rigidBody.dx += 1 * speed;
rigidBody.dx += 1 * speed * Time.deltaTime;
//if()

View File

@ -2,6 +2,7 @@ package spacewars;
import java.io.File;
import diveengine2d.DebugSettings;
import diveengine2d.Engine;
public class SpaceWars {
@ -12,7 +13,7 @@ public class SpaceWars {
private static void test(String game) {
final String gamePath = "" + new File(SpaceWars.class.getProtectionDomain().getCodeSource()
.getLocation().getPath().replace("%20", " ") + game).getPath();
DebugSettings.debugLevel = 1;
Engine engine = new Engine(gamePath);
}
}