Skip to content

Commit 09ac326

Browse files
committedJun 11, 2021
Initial Commit
0 parents  commit 09ac326

14 files changed

+354
-0
lines changed
 

‎.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
icon.png filter=lfs diff=lfs merge=lfs -text
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source_md5="47313fa4c47a9963fddd764e1ec6e4a8"
2+
dest_md5="2ded9e7f9060e2b530aab678b135fc5b"
3+
Binary file not shown.

‎Doople.gd

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
extends KinematicBody2D
2+
3+
var velocity := Vector2.ZERO
4+
var speed := 200.0
5+
var acceleration := 0.2
6+
7+
func _ready():
8+
pass
9+
10+
func _process(delta):
11+
velocity = Vector2.ZERO
12+
if Input.is_action_pressed("doople_up"):
13+
velocity.y -= 1.0
14+
elif Input.is_action_pressed("doople_down"):
15+
velocity.y += 1.0
16+
if Input.is_action_pressed("doople_left"):
17+
velocity.x -= 1.0
18+
elif Input.is_action_pressed("doople_right"):
19+
velocity.x += 1.0
20+
21+
velocity = velocity.normalized() * speed
22+
23+
# TODO(koger): Movement is snappy. Is this desirable? Do we want acceleration,
24+
# sliding, and other effects that make it feel more slugish?
25+
func _physics_process(delta):
26+
velocity = move_and_slide(velocity)

‎Doople.tscn

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://icon.png" type="Texture" id=1]
4+
[ext_resource path="res://Doople.gd" type="Script" id=2]
5+
6+
[sub_resource type="RectangleShape2D" id=1]
7+
extents = Vector2( 16, 16 )
8+
9+
[node name="Doople" type="KinematicBody2D"]
10+
script = ExtResource( 2 )
11+
12+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
13+
shape = SubResource( 1 )
14+
15+
[node name="Sprite" type="Sprite" parent="."]
16+
modulate = Color( 0.14902, 0.996078, 0, 1 )
17+
scale = Vector2( 0.5, 0.5 )
18+
texture = ExtResource( 1 )

‎Flump.tscn

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://icon.png" type="Texture" id=1]
4+
[ext_resource path="res://scripts/Flump.gd" type="Script" id=2]
5+
6+
[sub_resource type="RectangleShape2D" id=1]
7+
extents = Vector2( 16, 16 )
8+
9+
[node name="Flump" type="KinematicBody2D"]
10+
script = ExtResource( 2 )
11+
12+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
13+
shape = SubResource( 1 )
14+
15+
[node name="Sprite" type="Sprite" parent="."]
16+
modulate = Color( 0.262745, 0.705882, 1, 1 )
17+
scale = Vector2( 0.5, 0.5 )
18+
texture = ExtResource( 1 )

‎Foo.gd

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
extends KinematicBody2D
2+
3+
export var target_path : NodePath = ""
4+
5+
var velocity := Vector2.ZERO
6+
var speed := 100.0
7+
var direction := Vector2.ZERO
8+
9+
func _ready():
10+
_adjust_direction()
11+
12+
func _process(delta):
13+
velocity = direction
14+
velocity = velocity.normalized() * speed
15+
16+
# TODO(koger): Movement is snappy. Is this desirable? Do we want acceleration,
17+
# sliding, and other effects that make it feel more slugish?
18+
func _physics_process(delta):
19+
var collision = move_and_collide(velocity*delta)
20+
if collision:
21+
_adjust_direction()
22+
# direction = Vector2.ZERO
23+
# $Timer.start()
24+
25+
func _adjust_direction():
26+
var target = get_node(target_path)
27+
direction = target.global_position - global_position
28+
29+
30+
func _on_Timer_timeout():
31+
_adjust_direction()

‎Foo.tscn

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[gd_scene load_steps=4 format=2]
2+
3+
[ext_resource path="res://icon.png" type="Texture" id=1]
4+
[ext_resource path="res://Foo.gd" type="Script" id=2]
5+
6+
[sub_resource type="RectangleShape2D" id=1]
7+
extents = Vector2( 16, 16 )
8+
9+
[node name="Foo" type="KinematicBody2D"]
10+
script = ExtResource( 2 )
11+
12+
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
13+
shape = SubResource( 1 )
14+
15+
[node name="Sprite" type="Sprite" parent="."]
16+
modulate = Color( 0.933333, 0.0509804, 0.0509804, 1 )
17+
scale = Vector2( 0.5, 0.5 )
18+
texture = ExtResource( 1 )
19+
20+
[node name="Timer" type="Timer" parent="."]
21+
one_shot = true
22+
23+
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

‎SimpleMap.tscn

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
[gd_scene load_steps=9 format=2]
2+
3+
[ext_resource path="res://Flump.tscn" type="PackedScene" id=1]
4+
[ext_resource path="res://Doople.tscn" type="PackedScene" id=2]
5+
[ext_resource path="res://Foo.tscn" type="PackedScene" id=3]
6+
7+
[sub_resource type="RectangleShape2D" id=1]
8+
extents = Vector2( 10, 300 )
9+
10+
[sub_resource type="RectangleShape2D" id=2]
11+
extents = Vector2( 10, 300 )
12+
13+
[sub_resource type="RectangleShape2D" id=3]
14+
extents = Vector2( 10, 300 )
15+
16+
[sub_resource type="RectangleShape2D" id=4]
17+
extents = Vector2( 512, 10 )
18+
19+
[sub_resource type="RectangleShape2D" id=5]
20+
extents = Vector2( 512, 10 )
21+
22+
[node name="SimpleMap" type="Node2D"]
23+
24+
[node name="StaticBody2D" type="StaticBody2D" parent="."]
25+
26+
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
27+
position = Vector2( 502, 0 )
28+
shape = SubResource( 1 )
29+
30+
[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"]
31+
position = Vector2( -502, 0 )
32+
shape = SubResource( 2 )
33+
34+
[node name="CollisionShape2D5" type="CollisionShape2D" parent="StaticBody2D"]
35+
shape = SubResource( 3 )
36+
37+
[node name="CollisionShape2D3" type="CollisionShape2D" parent="StaticBody2D"]
38+
position = Vector2( 0, 290 )
39+
shape = SubResource( 4 )
40+
41+
[node name="CollisionShape2D4" type="CollisionShape2D" parent="StaticBody2D"]
42+
position = Vector2( 0, -290 )
43+
shape = SubResource( 5 )
44+
45+
[node name="Camera2D" type="Camera2D" parent="."]
46+
current = true
47+
48+
[node name="Flump" parent="." instance=ExtResource( 1 )]
49+
position = Vector2( -320, -96 )
50+
51+
[node name="Doople" parent="." instance=ExtResource( 2 )]
52+
position = Vector2( 192, -80 )
53+
54+
[node name="Foo" parent="." instance=ExtResource( 3 )]
55+
position = Vector2( -120, 0 )
56+
target_path = NodePath("../Flump")
57+
58+
[node name="Foo3" parent="." instance=ExtResource( 3 )]
59+
position = Vector2( -256, 80 )
60+
target_path = NodePath("../Flump")
61+
62+
[node name="Foo4" parent="." instance=ExtResource( 3 )]
63+
position = Vector2( -96, -216 )
64+
target_path = NodePath("../Flump")
65+
66+
[node name="Foo5" parent="." instance=ExtResource( 3 )]
67+
position = Vector2( -416, 216 )
68+
target_path = NodePath("../Flump")
69+
70+
[node name="Foo2" parent="." instance=ExtResource( 3 )]
71+
position = Vector2( 192, 56 )
72+
target_path = NodePath("../Doople")
73+
74+
[node name="Foo6" parent="." instance=ExtResource( 3 )]
75+
position = Vector2( 408, -216 )
76+
target_path = NodePath("../Doople")
77+
78+
[node name="Foo7" parent="." instance=ExtResource( 3 )]
79+
position = Vector2( 96, -240 )
80+
target_path = NodePath("../Doople")

‎default_env.tres

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[gd_resource type="Environment" load_steps=2 format=2]
2+
3+
[sub_resource type="ProceduralSky" id=1]
4+
5+
[resource]
6+
background_mode = 2
7+
background_sky = SubResource( 1 )

‎icon.png

+3
Loading

‎icon.png.import

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://icon.png"
13+
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=true
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=true
34+
svg/scale=1.0

‎project.godot

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
; Engine configuration file.
2+
; It's best edited using the editor UI and not directly,
3+
; since the parameters that go here are not all obvious.
4+
;
5+
; Format:
6+
; [section] ; section goes between []
7+
; param=value ; assign values to parameters
8+
9+
config_version=4
10+
11+
[application]
12+
13+
config/name="Flump & Doople"
14+
config/icon="res://icon.png"
15+
16+
[input]
17+
18+
right={
19+
"deadzone": 0.5,
20+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
21+
]
22+
}
23+
left={
24+
"deadzone": 0.5,
25+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
26+
]
27+
}
28+
up={
29+
"deadzone": 0.5,
30+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
31+
]
32+
}
33+
down={
34+
"deadzone": 0.5,
35+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
36+
]
37+
}
38+
flump_up={
39+
"deadzone": 0.5,
40+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
41+
]
42+
}
43+
flump_down={
44+
"deadzone": 0.5,
45+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
46+
]
47+
}
48+
flump_right={
49+
"deadzone": 0.5,
50+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
51+
]
52+
}
53+
flump_left={
54+
"deadzone": 0.5,
55+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
56+
]
57+
}
58+
doople_up={
59+
"deadzone": 0.5,
60+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
61+
]
62+
}
63+
doople_down={
64+
"deadzone": 0.5,
65+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
66+
]
67+
}
68+
doople_right={
69+
"deadzone": 0.5,
70+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
71+
]
72+
}
73+
doople_left={
74+
"deadzone": 0.5,
75+
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
76+
]
77+
}
78+
79+
[physics]
80+
81+
common/enable_pause_aware_picking=true
82+
83+
[rendering]
84+
85+
environment/default_environment="res://default_env.tres"

‎scripts/Flump.gd

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
extends KinematicBody2D
2+
3+
var velocity := Vector2.ZERO
4+
var speed := 200.0
5+
6+
func _ready():
7+
pass
8+
9+
func _process(delta):
10+
velocity = Vector2.ZERO
11+
if Input.is_action_pressed("flump_up"):
12+
velocity.y -= 1.0
13+
elif Input.is_action_pressed("flump_down"):
14+
velocity.y += 1.0
15+
if Input.is_action_pressed("flump_left"):
16+
velocity.x -= 1.0
17+
elif Input.is_action_pressed("flump_right"):
18+
velocity.x += 1.0
19+
20+
velocity = velocity.normalized() * speed
21+
22+
# TODO(koger): Movement is snappy. Is this desirable? Do we want acceleration,
23+
# sliding, and other effects that make it feel more slugish?
24+
func _physics_process(delta):
25+
velocity = move_and_slide(velocity)

0 commit comments

Comments
 (0)
Please sign in to comment.