From a48a9a13109a363a3fb5564681f17f1c91902b67 Mon Sep 17 00:00:00 2001 From: John Murphy Date: Sat, 9 Sep 2017 23:43:18 -0700 Subject: [PATCH] first commit --- earth.gd | 2 +- eartharea.gd | 3 ++- moon.gd | 2 +- rocket.gd | 14 +++++--------- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/earth.gd b/earth.gd index fcf6cc5..b6b316c 100644 --- a/earth.gd +++ b/earth.gd @@ -5,7 +5,7 @@ extends KinematicBody2D # var b = "textvar" func _fixed_process(delta): - move(Vector2(0.3,0.5)) + move(Vector2(0.1,0.2)) #pass func _ready(): diff --git a/eartharea.gd b/eartharea.gd index 1a3518e..fed51e1 100644 --- a/eartharea.gd +++ b/eartharea.gd @@ -5,7 +5,8 @@ extends Area2D # var b = "textvar" func _fixed_process(delta): - pass + #pass + print(is_gravity_a_point()) func _ready(): # Called every time the node is added to the scene. diff --git a/moon.gd b/moon.gd index 6f83cd7..4b4039d 100644 --- a/moon.gd +++ b/moon.gd @@ -5,7 +5,7 @@ extends KinematicBody2D # var b = "textvar" func _fixed_process(delta): - move(Vector2(0.2,0.4)) + move(Vector2(0.1,0.1)) #pass func _ready(): diff --git a/rocket.gd b/rocket.gd index aaf2a07..3e09557 100644 --- a/rocket.gd +++ b/rocket.gd @@ -1,8 +1,6 @@ extends RigidBody2D -# class member variables go here, for example: -# var a = 2 -# var b = "textvar" + var time = 0.0 var thrust_force = Vector2() var thrust @@ -10,10 +8,8 @@ var revthrust var bear_left var bear_right -func calc_moon_gravity(): - pass - -func _process(delta): + +func _input(delta): # var lv = s.get_linear_velocity() # var step = s.get_step() var rotation = get_rot() @@ -28,13 +24,12 @@ func _process(delta): func _fixed_process(delta): time += delta - print(time) + # print(time) if (thrust): # print("Rotation: ", rotation, " Linear velocity: ", lv, " sin rotation: ", sin(rotation), " cos rotation: ", cos(rotation)) apply_impulse(Vector2(0,0), -thrust_force) if (revthrust): - # print("Rotation: ", rotation, " Linear velocity: ", lv, " sin rotation: ", sin(rotation), " cos rotation: ", cos(rotation)) apply_impulse(Vector2(0,0), thrust_force) if (bear_left): rotate(0.1) @@ -44,4 +39,5 @@ func _fixed_process(delta): func _ready(): # set_gravity_scale(1) set_process(true) + set_process_input(true) set_fixed_process(true) \ No newline at end of file