First commit

This commit is contained in:
John Murphy
2017-09-09 23:02:01 -07:00
commit 1edf82bc30
17 changed files with 331 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

+34
View File
@@ -0,0 +1,34 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://earth.gd" type="Script" id=1]
[ext_resource path="res://Earth-800px.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 10.0
[node name="Earth" type="KinematicBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 20, 0, 0, 20, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.08
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
transform/scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/scale = Vector2( 20, 20 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = 0
+15
View File
@@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=1]
[ext_resource path="res://eartharea.gd" type="Script" id=1]
[node name="Area2D" type="Area2D"]
input/pickable = true
space_override = 3
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )
+18
View File
@@ -0,0 +1,18 @@
extends Node2D
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _process(delta):
pass
func _ready():
# Called every time the node is added to the scene.
# Initialization here
var space = get_world_2d().get_space()
Physics2DServer.area_set_param(space, Physics2DServer.AREA_PARAM_GRAVITY, 0)
Physics2DServer.area_set_param(space, Physics2DServer.AREA_PARAM_GRAVITY_VECTOR, Vector2(0,1))
set_process(true)
+54
View File
@@ -0,0 +1,54 @@
[gd_scene load_steps=7 format=1]
[ext_resource path="res://Level.gd" type="Script" id=1]
[ext_resource path="res://Rocket.tscn" type="PackedScene" id=2]
[ext_resource path="res://Moon.tscn" type="PackedScene" id=3]
[ext_resource path="res://Earth.tscn" type="PackedScene" id=4]
[ext_resource path="res://EarthArea.tscn" type="PackedScene" id=5]
[ext_resource path="res://camera.gd" type="Script" id=6]
[node name="MoonSpace" type="Node2D"]
script/script = ExtResource( 1 )
[node name="Rocket" parent="." instance=ExtResource( 2 )]
transform/pos = Vector2( 246.872, 361.618 )
[node name="Moon" parent="." instance=ExtResource( 3 )]
transform/pos = Vector2( 1347.34, 318.09 )
[node name="Earth" parent="." instance=ExtResource( 4 )]
transform/pos = Vector2( 250, 600 )
[node name="Area2D" parent="Earth" instance=ExtResource( 5 )]
transform/scale = Vector2( 10, 10 )
gravity_point = true
gravity_distance_scale = 1.0
gravity = 1000.0
[node name="Camera2D" type="Camera2D" parent="."]
transform/pos = Vector2( 960, 540 )
anchor_mode = 1
rotating = false
current = false
zoom = Vector2( 1, 1 )
limit/left = -10000000
limit/top = -10000000
limit/right = 10000000
limit/bottom = 10000000
drag_margin/h_enabled = true
drag_margin/v_enabled = true
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2
script/script = ExtResource( 6 )
+33
View File
@@ -0,0 +1,33 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://moon.gd" type="Script" id=1]
[ext_resource path="res://1311069131-800px.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 80.0
[node name="Moon" type="KinematicBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
collision/margin = 0.08
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
transform/scale = Vector2( 0.2, 0.2 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
trigger = false
_update_shape_index = 0
+49
View File
@@ -0,0 +1,49 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://rocket.gd" type="Script" id=1]
[ext_resource path="res://rocket-297573-800px.png" type="Texture" id=2]
[sub_resource type="RectangleShape2D" id=1]
custom_solver_bias = 0.0
extents = Vector2( 10, 10 )
[node name="Rocket" type="RigidBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1.51812, 0, 0, 3.70819, 0.571488, 1.47728 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 0
mass = 10.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
script/script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
transform/scale = Vector2( 0.1, 0.1 )
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 0.571488, 1.47728 )
transform/scale = Vector2( 1.51812, 3.70819 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = 0
+14
View File
@@ -0,0 +1,14 @@
extends Camera2D
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _process(delta):
var current_pos = get_pos()
set_pos(current_pos.x - 200*delta, current_pos.y - delta)
func _ready():
# Called every time the node is added to the scene.
# Initialization here
pass
+14
View File
@@ -0,0 +1,14 @@
extends KinematicBody2D
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _fixed_process(delta):
move(Vector2(0.3,0.5))
#pass
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_fixed_process(true)
+15
View File
@@ -0,0 +1,15 @@
extends Area2D
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _fixed_process(delta):
pass
func _ready():
# Called every time the node is added to the scene.
# Initialization here
set_fixed_process(true)
set_gravity_is_point(true)
set_gravity(1000)
+22
View File
@@ -0,0 +1,22 @@
[application]
name="MoonLaunch"
main_scene="res://Level.tscn"
icon="res://icon.png"
[display]
width=1920
height=1080
[input]
thrust=[key(Up)]
revthrust=[key(Down)]
bear_right=[key(Right)]
bear_left=[key(Left)]
[physics]
default_gravity_vector=Vector3(1, 0, 0)
default_gravity=1.0
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

+1
View File
@@ -0,0 +1 @@
gen_mipmaps=false
+15
View File
@@ -0,0 +1,15 @@
extends KinematicBody2D
# class member variables go here, for example:
# var a = 2
# var b = "textvar"
func _fixed_process(delta):
move(Vector2(0.2,0.4))
#pass
func _ready():
set_fixed_process(true)
Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+47
View File
@@ -0,0 +1,47 @@
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
var revthrust
var bear_left
var bear_right
func calc_moon_gravity():
pass
func _process(delta):
# var lv = s.get_linear_velocity()
# var step = s.get_step()
var rotation = get_rot()
# Get the controls
thrust = Input.is_action_pressed("thrust")
revthrust = Input.is_action_pressed("revthrust")
bear_left = Input.is_action_pressed("bear_left")
bear_right = Input.is_action_pressed("bear_right")
thrust_force = 5*Vector2(sin(rotation), cos(rotation))
func _fixed_process(delta):
time += delta
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)
if (bear_right):
rotate(-0.1)
func _ready():
# set_gravity_scale(1)
set_process(true)
set_fixed_process(true)