yep
parent
5e1777bafc
commit
d1bb727dd1
|
|
@ -11,7 +11,23 @@ End Component
|
||||||
|
|
||||||
Template player
|
Template player
|
||||||
|
|
||||||
|
|
||||||
|
#THE GROUND
|
||||||
[Entity]
|
[Entity]
|
||||||
$name = "Scene Manager"
|
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
|
||||||
Component SceneManager
|
$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
|
End Component
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
[Entity]
|
[Entity]
|
||||||
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
|
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
|
||||||
$name = "Player"
|
$name = "Player"
|
||||||
|
$x = 504f
|
||||||
|
$y = 50f
|
||||||
|
|
||||||
Component spacewars.PlayerController
|
Component spacewars.PlayerController
|
||||||
$name = "player controller"
|
$name = "player controller"
|
||||||
$message = "hello from the script!"
|
$speed = 1f
|
||||||
$speed = .00000000001f
|
|
||||||
End Component
|
End Component
|
||||||
|
|
||||||
Component RectRenderer
|
Component RectRenderer
|
||||||
$name = "render!"
|
$name = "render!"
|
||||||
$width = 16i
|
$width = 16i
|
||||||
$height = 16i
|
$height = 16i
|
||||||
$color = #FA05BB
|
$color = #e91e63
|
||||||
End Component
|
End Component
|
||||||
|
|
||||||
Component RigidBody
|
Component RigidBody
|
||||||
$name = "poop"
|
$name = "poop"
|
||||||
$friction = .9F
|
$dy = 5f
|
||||||
|
$friction = .9f
|
||||||
End Component
|
End Component
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,23 @@ End Component
|
||||||
|
|
||||||
Template player
|
Template player
|
||||||
|
|
||||||
|
|
||||||
|
#THE GROUND
|
||||||
[Entity]
|
[Entity]
|
||||||
$name = "Scene Manager"
|
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
|
||||||
Component SceneManager
|
$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
|
End Component
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
[Entity]
|
[Entity]
|
||||||
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
|
$GUID = "9e477f6d-778d-43e2-afe0-028a0a99cd74"
|
||||||
$name = "Player"
|
$name = "Player"
|
||||||
|
$x = 504f
|
||||||
|
$y = 50f
|
||||||
|
|
||||||
Component spacewars.PlayerController
|
Component spacewars.PlayerController
|
||||||
$name = "player controller"
|
$name = "player controller"
|
||||||
$message = "hello from the script!"
|
$speed = 1f
|
||||||
$speed = .00000000001f
|
|
||||||
End Component
|
End Component
|
||||||
|
|
||||||
Component RectRenderer
|
Component RectRenderer
|
||||||
$name = "render!"
|
$name = "render!"
|
||||||
$width = 16i
|
$width = 16i
|
||||||
$height = 16i
|
$height = 16i
|
||||||
$color = #FA05BB
|
$color = #e91e63
|
||||||
End Component
|
End Component
|
||||||
|
|
||||||
Component RigidBody
|
Component RigidBody
|
||||||
$name = "poop"
|
$name = "poop"
|
||||||
$friction = .9F
|
$dy = 5f
|
||||||
|
$friction = .9f
|
||||||
End Component
|
End Component
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@ public class PlayerController extends DiveScript implements KeyListener {
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
if(Input.getKeyDown(KeyEvent.VK_W))
|
if(Input.getKeyDown(KeyEvent.VK_W))
|
||||||
rigidBody.dy += -1 * speed;
|
rigidBody.dy += -1 * speed * Time.deltaTime;
|
||||||
if(Input.getKeyDown(KeyEvent.VK_S))
|
if(Input.getKeyDown(KeyEvent.VK_S))
|
||||||
rigidBody.dy += 1 * speed;
|
rigidBody.dy += 1 * speed * Time.deltaTime;
|
||||||
if(Input.getKeyDown(KeyEvent.VK_A))
|
if(Input.getKeyDown(KeyEvent.VK_A))
|
||||||
rigidBody.dx += -1 * speed;
|
rigidBody.dx += -1 * speed * Time.deltaTime;
|
||||||
if(Input.getKeyDown(KeyEvent.VK_D))
|
if(Input.getKeyDown(KeyEvent.VK_D))
|
||||||
rigidBody.dx += 1 * speed;
|
rigidBody.dx += 1 * speed * Time.deltaTime;
|
||||||
|
|
||||||
//if()
|
//if()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package spacewars;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
import diveengine2d.DebugSettings;
|
||||||
import diveengine2d.Engine;
|
import diveengine2d.Engine;
|
||||||
|
|
||||||
public class SpaceWars {
|
public class SpaceWars {
|
||||||
|
|
@ -12,7 +13,7 @@ public class SpaceWars {
|
||||||
private static void test(String game) {
|
private static void test(String game) {
|
||||||
final String gamePath = "" + new File(SpaceWars.class.getProtectionDomain().getCodeSource()
|
final String gamePath = "" + new File(SpaceWars.class.getProtectionDomain().getCodeSource()
|
||||||
.getLocation().getPath().replace("%20", " ") + game).getPath();
|
.getLocation().getPath().replace("%20", " ") + game).getPath();
|
||||||
|
DebugSettings.debugLevel = 1;
|
||||||
Engine engine = new Engine(gamePath);
|
Engine engine = new Engine(gamePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue