2d/physics_platformer works flawlessly on Godot 3.1 beta 8 (#312)
* 2d/physics_platformer works flawlessly on Godot 3.1 beta 8 * fix warnings for inferred node type * every script has a class_name * formatted code for better clarity * each files has its own subfolder * bullet collisions and shooting have to be executed from call_deferred * PascalCase naming for nodes
279
2d/physics_platformer/Stage.tscn
Normal file
35
2d/physics_platformer/Stage2.tscn
Normal file
159
2d/physics_platformer/TilesetEdit.tscn
Normal file
@@ -0,0 +1,159 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://tiles_demo.png" type="Texture" id=1]
|
||||
|
||||
[node name="Node" type="Node"]
|
||||
|
||||
[node name="Floor" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 0, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Floor"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Floor/Collision"]
|
||||
polygon = PoolVector2Array( 32, -24, 32, 32, -32, 32, -32, -24 )
|
||||
|
||||
[node name="Edge" type="Sprite" parent="."]
|
||||
position = Vector2( 64, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 64, 0, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Edge"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Edge/Collision"]
|
||||
polygon = PoolVector2Array( -32, -24, 24, -24, 24, 32, -32, 32 )
|
||||
|
||||
[node name="Wall" type="Sprite" parent="."]
|
||||
position = Vector2( 64, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 64, 64, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Wall"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Wall/Collision"]
|
||||
polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
|
||||
|
||||
[node name="WallDeco" type="Sprite" parent="."]
|
||||
position = Vector2( 96, 128 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 320, 128, 128, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="WallDeco"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="WallDeco/Collision"]
|
||||
polygon = PoolVector2Array( -64, -32, -8, -32, -8, 32, -64, 32 )
|
||||
|
||||
[node name="Corner" type="Sprite" parent="."]
|
||||
position = Vector2( 64, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 64, 128, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Corner"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Corner/Collision"]
|
||||
polygon = PoolVector2Array( -32, -32, 24, -32, 32, -24, 32, 32, -32, 32 )
|
||||
|
||||
[node name="Flowers" type="Sprite" parent="."]
|
||||
position = Vector2( 128, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 192, 192, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Flowers"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Flowers/Collision"]
|
||||
polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
|
||||
|
||||
[node name="TreeBase" type="Sprite" parent="."]
|
||||
position = Vector2( 192, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 192, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="TreeBase"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="TreeBase/Collision"]
|
||||
polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
|
||||
|
||||
[node name="TreeMid" type="Sprite" parent="."]
|
||||
position = Vector2( 192, 128 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 128, 64, 64 )
|
||||
|
||||
[node name="TreeMid2" type="Sprite" parent="."]
|
||||
position = Vector2( 192, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 64, 64, 64 )
|
||||
|
||||
[node name="TreeTop" type="Sprite" parent="."]
|
||||
position = Vector2( 192, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 0, 64, 64 )
|
||||
|
||||
[node name="Solid" type="Sprite" parent="."]
|
||||
position = Vector2( 0, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 64, 64, 64 )
|
||||
|
||||
[node name="Ceiling" type="Sprite" parent="."]
|
||||
position = Vector2( 0, 128 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 384, 64, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Ceiling"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Ceiling/Collision"]
|
||||
polygon = PoolVector2Array( 32, -32, 32, 32, -32, 32, -32, -32 )
|
||||
|
||||
[node name="Ramp" type="Sprite" parent="."]
|
||||
position = Vector2( 256, 224 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 128, 128, 64, 128 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="Ramp"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Ramp/Collision"]
|
||||
polygon = PoolVector2Array( -32, -56, 32, 8, 32, 64, -32, 64 )
|
||||
|
||||
[node name="CeilingWall" type="Sprite" parent="."]
|
||||
position = Vector2( 0, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 448, 64, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="CeilingWall"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="CeilingWall/Collision"]
|
||||
polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
|
||||
|
||||
[node name="PlatformFloor" type="Sprite" parent="."]
|
||||
position = Vector2( 0, 256 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 128, 0, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="PlatformFloor"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PlatformFloor/Collision"]
|
||||
polygon = PoolVector2Array( 32, -24, 32, 24, -32, 24, -32, -24 )
|
||||
|
||||
[node name="PlatformEdge" type="Sprite" parent="."]
|
||||
position = Vector2( 64, 256 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 192, 0, 64, 64 )
|
||||
|
||||
[node name="Collision" type="StaticBody2D" parent="PlatformEdge"]
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PlatformEdge/Collision"]
|
||||
polygon = PoolVector2Array( 24, -24, 24, 24, -32, 24, -32, -24 )
|
||||
|
||||
[node name="Help" type="Label" parent="."]
|
||||
margin_left = 1.0
|
||||
margin_top = 331.0
|
||||
margin_right = 727.0
|
||||
margin_bottom = 422.0
|
||||
size_flags_horizontal = 2
|
||||
text = "This scene serves as a tool for editing the tileset.
|
||||
Nodes (sprites) and their respective collisionsare edited here.
|
||||
|
||||
To create a tileset from this, a \"TileSet\" resoucre must be created. Use the helper in: Scene -> Convert To -> TileSet.
|
||||
This will save a tileset. Saving over it will merge your changes.
|
||||
|
||||
Finally, the saved tileset resource (tileset.tres in this case), can be opened to be used into a TileMap node for editing a tile map."
|
||||
|
||||
15
2d/physics_platformer/audio/music.ogg.import
Normal file
@@ -0,0 +1,15 @@
|
||||
[remap]
|
||||
|
||||
importer="ogg_vorbis"
|
||||
type="AudioStreamOGGVorbis"
|
||||
path="res://.import/music.ogg-552a37c4bfe46d894cb8004cf1c345ad.oggstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/music.ogg"
|
||||
dest_files=[ "res://.import/music.ogg-552a37c4bfe46d894cb8004cf1c345ad.oggstr" ]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
||||
21
2d/physics_platformer/audio/sound_coin.wav.import
Normal file
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_coin.wav-e18cceeba8b7dc02bbb940b85bcad99a.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/sound_coin.wav"
|
||||
dest_files=[ "res://.import/sound_coin.wav-e18cceeba8b7dc02bbb940b85bcad99a.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
21
2d/physics_platformer/audio/sound_explode.wav.import
Normal file
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_explode.wav-536668d880bfb277b9e5253774598e9e.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/sound_explode.wav"
|
||||
dest_files=[ "res://.import/sound_explode.wav-536668d880bfb277b9e5253774598e9e.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
21
2d/physics_platformer/audio/sound_hit.wav.import
Normal file
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_hit.wav-6c98c4eeb2c6ac3fc45dc4a7ebd8602f.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/sound_hit.wav"
|
||||
dest_files=[ "res://.import/sound_hit.wav-6c98c4eeb2c6ac3fc45dc4a7ebd8602f.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
21
2d/physics_platformer/audio/sound_jump.wav.import
Normal file
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_jump.wav-7e05b84e4426c7461dd15838765e210b.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/sound_jump.wav"
|
||||
dest_files=[ "res://.import/sound_jump.wav-7e05b84e4426c7461dd15838765e210b.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
21
2d/physics_platformer/audio/sound_shoot.wav.import
Normal file
@@ -0,0 +1,21 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_shoot.wav-a37772efd1dbcd76c4fe35742f502bb7.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://audio/sound_shoot.wav"
|
||||
dest_files=[ "res://.import/sound_shoot.wav-a37772efd1dbcd76c4fe35742f502bb7.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
74
2d/physics_platformer/background/ParallaxBg.tscn
Normal file
@@ -0,0 +1,74 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://background/scroll_bg_sky.png" type="Texture" id=1]
|
||||
[ext_resource path="res://background/scroll_bg_cloud_1.png" type="Texture" id=2]
|
||||
[ext_resource path="res://background/scroll_bg_cloud_2.png" type="Texture" id=3]
|
||||
[ext_resource path="res://background/scroll_bg_cloud_3.png" type="Texture" id=4]
|
||||
[ext_resource path="res://background/scroll_bg_fg_2.png" type="Texture" id=5]
|
||||
[ext_resource path="res://background/scroll_bg_fg_1.png" type="Texture" id=6]
|
||||
|
||||
[node name="ParallaxBg" type="ParallaxBackground"]
|
||||
scroll_base_scale = Vector2( 0.7, 0 )
|
||||
|
||||
[node name="Sky" type="ParallaxLayer" parent="."]
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Sky"]
|
||||
scale = Vector2( 32, 0.94 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
|
||||
[node name="Clouds" type="ParallaxLayer" parent="."]
|
||||
motion_scale = Vector2( 0.1, 1 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite1" type="Sprite" parent="Clouds"]
|
||||
position = Vector2( 28, 127 )
|
||||
texture = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite2" type="Sprite" parent="Clouds"]
|
||||
position = Vector2( 404, 24 )
|
||||
texture = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite3" type="Sprite" parent="Clouds"]
|
||||
position = Vector2( 154, 46 )
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite4" type="Sprite" parent="Clouds"]
|
||||
position = Vector2( 525, 130 )
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite5" type="Sprite" parent="Clouds"]
|
||||
position = Vector2( 255, 158 )
|
||||
texture = ExtResource( 4 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite6" type="Sprite" parent="Clouds"]
|
||||
position = Vector2( 674, 70 )
|
||||
texture = ExtResource( 4 )
|
||||
centered = false
|
||||
|
||||
[node name="Mount2" type="ParallaxLayer" parent="."]
|
||||
motion_scale = Vector2( 0.2, 1 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Mount2"]
|
||||
position = Vector2( 0, 225 )
|
||||
texture = ExtResource( 5 )
|
||||
centered = false
|
||||
region_rect = Rect2( 0, 0, 800, 256 )
|
||||
|
||||
[node name="Mount1" type="ParallaxLayer" parent="."]
|
||||
motion_scale = Vector2( 0.4, 1 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Mount1"]
|
||||
position = Vector2( 0, 225 )
|
||||
texture = ExtResource( 6 )
|
||||
centered = false
|
||||
region_rect = Rect2( 0, 0, 800, 256 )
|
||||
|
||||
26
2d/physics_platformer/background/Seesaw.tscn
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://background/plank.png" type="Texture" id=1]
|
||||
[ext_resource path="res://background/plankpin.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 128, 8 )
|
||||
|
||||
[node name="Seesaw" type="Node2D"]
|
||||
|
||||
[node name="Plank" type="RigidBody2D" parent="."]
|
||||
mass = 5.10204
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Plank"]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Plank"]
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Pin" type="PinJoint2D" parent="."]
|
||||
node_a = NodePath("../plank")
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( -0.290825, 20.2425 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
|
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/plank.png-1bbc55bc0ea546386ad520f861cb9ff9.stex"
|
||||
path="res://.import/plank.png-d70731fc82f225d8353819786c2ed28a.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://plank.png"
|
||||
source_md5="28f8eb328fb1fde3d65c243e1ae25725"
|
||||
|
||||
dest_files=[ "res://.import/plank.png-1bbc55bc0ea546386ad520f861cb9ff9.stex" ]
|
||||
dest_md5="4fe094c2877ef1b9c6ede602be7118ec"
|
||||
source_file="res://background/plank.png"
|
||||
dest_files=[ "res://.import/plank.png-d70731fc82f225d8353819786c2ed28a.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/plankpin.png-5a03e8bdc3cbf81fc9d7a4c7873b7dc0.stex"
|
||||
path="res://.import/plankpin.png-68d06cc4b9ab95f9d0142d1a4c768140.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://plankpin.png"
|
||||
source_md5="ac4e469b71f5d466f8212f0d6c8ca7aa"
|
||||
|
||||
dest_files=[ "res://.import/plankpin.png-5a03e8bdc3cbf81fc9d7a4c7873b7dc0.stex" ]
|
||||
dest_md5="99fa804f6514a65d1f533d80da8e54bf"
|
||||
source_file="res://background/plankpin.png"
|
||||
dest_files=[ "res://.import/plankpin.png-68d06cc4b9ab95f9d0142d1a4c768140.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 531 B After Width: | Height: | Size: 531 B |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/scroll_bg_cloud_1.png-bad76c04aedb60c1b863fc1c1c6387ee.stex"
|
||||
path="res://.import/scroll_bg_cloud_1.png-19f55c25a7e1985c92542faa0106888e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scroll_bg_cloud_1.png"
|
||||
source_md5="469ececd0862fb9ee972f4c9afa833e5"
|
||||
|
||||
dest_files=[ "res://.import/scroll_bg_cloud_1.png-bad76c04aedb60c1b863fc1c1c6387ee.stex" ]
|
||||
dest_md5="2bafbc3854a3abad3d1464c5793f5815"
|
||||
source_file="res://background/scroll_bg_cloud_1.png"
|
||||
dest_files=[ "res://.import/scroll_bg_cloud_1.png-19f55c25a7e1985c92542faa0106888e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 719 B After Width: | Height: | Size: 719 B |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/scroll_bg_cloud_2.png-cb251e8e91cb5450d56a9d0584943db0.stex"
|
||||
path="res://.import/scroll_bg_cloud_2.png-869806dcc546591f3d754e3b845c61c9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scroll_bg_cloud_2.png"
|
||||
source_md5="5acccab15a17f158a267e2cbf2c8d037"
|
||||
|
||||
dest_files=[ "res://.import/scroll_bg_cloud_2.png-cb251e8e91cb5450d56a9d0584943db0.stex" ]
|
||||
dest_md5="a8e0aaff2215a5fc5c4e98ac28cc7158"
|
||||
source_file="res://background/scroll_bg_cloud_2.png"
|
||||
dest_files=[ "res://.import/scroll_bg_cloud_2.png-869806dcc546591f3d754e3b845c61c9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 394 B |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/scroll_bg_cloud_3.png-6bbd67870db2f55a0c1b4685aa91e57c.stex"
|
||||
path="res://.import/scroll_bg_cloud_3.png-831c6ed9fa8b4070081428a936bcc2f7.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scroll_bg_cloud_3.png"
|
||||
source_md5="b5e117acfbd6979087b6ac12f030bfcb"
|
||||
|
||||
dest_files=[ "res://.import/scroll_bg_cloud_3.png-6bbd67870db2f55a0c1b4685aa91e57c.stex" ]
|
||||
dest_md5="156719b40a3d6eeb72c9992c371e9e06"
|
||||
source_file="res://background/scroll_bg_cloud_3.png"
|
||||
dest_files=[ "res://.import/scroll_bg_cloud_3.png-831c6ed9fa8b4070081428a936bcc2f7.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/scroll_bg_fg_1.png-af0d9d2847aea6e03f54efcc2d9b6f06.stex"
|
||||
path="res://.import/scroll_bg_fg_1.png-20c90ebded5095c6863cdf6b1b82882d.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scroll_bg_fg_1.png"
|
||||
source_md5="7b7b3b723bb49a3c3794fb11d24d7600"
|
||||
|
||||
dest_files=[ "res://.import/scroll_bg_fg_1.png-af0d9d2847aea6e03f54efcc2d9b6f06.stex" ]
|
||||
dest_md5="870592f1c5cb451e3b9b101d1f0f3cf2"
|
||||
source_file="res://background/scroll_bg_fg_1.png"
|
||||
dest_files=[ "res://.import/scroll_bg_fg_1.png-20c90ebded5095c6863cdf6b1b82882d.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/scroll_bg_fg_2.png-2419a5b3b81617ba71d0ad50d23bf6f1.stex"
|
||||
path="res://.import/scroll_bg_fg_2.png-2b54decd69e8aff2caa33640a336d1e9.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scroll_bg_fg_2.png"
|
||||
source_md5="4e0e7290a3706ac8b25a9cdcdcd86a22"
|
||||
|
||||
dest_files=[ "res://.import/scroll_bg_fg_2.png-2419a5b3b81617ba71d0ad50d23bf6f1.stex" ]
|
||||
dest_md5="c8ac2a13834166a1e6089723cff0b7e6"
|
||||
source_file="res://background/scroll_bg_fg_2.png"
|
||||
dest_files=[ "res://.import/scroll_bg_fg_2.png-2b54decd69e8aff2caa33640a336d1e9.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/scroll_bg_sky.png-df3e8b7d076f566a7bd83c6d4f9b57cf.stex"
|
||||
path="res://.import/scroll_bg_sky.png-377ea542199b2e23d7a822ed940ea99e.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://scroll_bg_sky.png"
|
||||
source_md5="8bd7da5f8f7bde4409890946fa92d678"
|
||||
|
||||
dest_files=[ "res://.import/scroll_bg_sky.png-df3e8b7d076f566a7bd83c6d4f9b57cf.stex" ]
|
||||
dest_md5="78e807a4df94f72516cc399479809e5a"
|
||||
source_file="res://background/scroll_bg_sky.png"
|
||||
dest_files=[ "res://.import/scroll_bg_sky.png-377ea542199b2e23d7a822ed940ea99e.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
@@ -1,173 +0,0 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://bullet.gd" type="Script" id=1]
|
||||
[ext_resource path="res://bullet.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id=1]
|
||||
|
||||
render_priority = 0
|
||||
blend_mode = 1
|
||||
light_mode = 0
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=4]
|
||||
|
||||
render_priority = 0
|
||||
trail_divisor = 1
|
||||
emission_shape = 0
|
||||
flag_align_y = false
|
||||
flag_rotate_y = false
|
||||
flag_disable_z = true
|
||||
spread = 0.0
|
||||
flatness = 0.0
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 1.0
|
||||
initial_velocity_random = 0.0
|
||||
angular_velocity = 38.0
|
||||
angular_velocity_random = 0.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
linear_accel = 0.0
|
||||
linear_accel_random = 0.0
|
||||
radial_accel = 0.0
|
||||
radial_accel_random = 0.0
|
||||
tangential_accel = 0.0
|
||||
tangential_accel_random = 0.0
|
||||
damping = 0.0
|
||||
damping_random = 0.0
|
||||
angle = 0.0
|
||||
angle_random = 0.0
|
||||
scale = 0.8
|
||||
scale_random = 0.0
|
||||
color = Color( 1, 1, 1, 1 )
|
||||
hue_variation = 0.0
|
||||
hue_variation_random = 0.0
|
||||
anim_speed = 0.0
|
||||
anim_speed_random = 0.0
|
||||
anim_offset = 0.0
|
||||
anim_offset_random = 0.0
|
||||
anim_loop = false
|
||||
_sections_unfolded = [ "Scale" ]
|
||||
|
||||
[sub_resource type="CircleShape2D" id=2]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
radius = 10.0
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
|
||||
length = 1.5
|
||||
loop = false
|
||||
step = 0.1
|
||||
tracks/0/type = "method"
|
||||
tracks/0/path = NodePath(".")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 1.31 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"values": [ {
|
||||
"args": [ ],
|
||||
"method": "queue_free"
|
||||
} ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("sprite:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 1.03 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Particles2D:self_modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[node name="bullet" type="RigidBody2D"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
mode = 0
|
||||
mass = 1.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
gravity_scale = 1.0
|
||||
custom_integrator = false
|
||||
continuous_cd = 2
|
||||
contacts_reported = 0
|
||||
contact_monitor = false
|
||||
sleeping = false
|
||||
can_sleep = true
|
||||
linear_velocity = Vector2( 0, 0 )
|
||||
linear_damp = -1.0
|
||||
angular_velocity = 0.0
|
||||
angular_damp = -1.0
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="." index="0"]
|
||||
|
||||
material = SubResource( 1 )
|
||||
emitting = true
|
||||
amount = 8
|
||||
lifetime = 0.3
|
||||
one_shot = false
|
||||
preprocess = 0.0
|
||||
speed_scale = 3.0
|
||||
explosiveness = 0.0
|
||||
randomness = 0.0
|
||||
fixed_fps = 0
|
||||
fract_delta = true
|
||||
visibility_rect = Rect2( -100, -100, 200, 200 )
|
||||
local_coords = false
|
||||
draw_order = 0
|
||||
process_material = SubResource( 4 )
|
||||
texture = ExtResource( 2 )
|
||||
normal_map = null
|
||||
h_frames = 1
|
||||
v_frames = 1
|
||||
_sections_unfolded = [ "Process Material", "Time", "Visibility" ]
|
||||
|
||||
[node name="sprite" type="Sprite" parent="." index="1"]
|
||||
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." index="2"]
|
||||
|
||||
shape = SubResource( 2 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="." index="3"]
|
||||
|
||||
process_mode = 1
|
||||
wait_time = 1.0
|
||||
one_shot = true
|
||||
autostart = false
|
||||
|
||||
[node name="anim" type="AnimationPlayer" parent="." index="4"]
|
||||
|
||||
playback_process_mode = 1
|
||||
playback_default_blend_time = 0.0
|
||||
root_node = NodePath("..")
|
||||
anims/shutdown = SubResource( 3 )
|
||||
playback/active = true
|
||||
playback/speed = 1.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="disable"]
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
extends Area2D
|
||||
|
||||
# Member variables
|
||||
var taken = false
|
||||
|
||||
|
||||
func _on_body_enter( body ):
|
||||
if not taken and body is preload("res://player.gd"):
|
||||
$anim.play("taken")
|
||||
taken = true
|
||||
|
||||
|
||||
func _on_coin_area_enter(area):
|
||||
pass # replace with function body
|
||||
|
||||
|
||||
func _on_coin_area_enter_shape(area_id, area, area_shape, area_shape):
|
||||
pass # replace with function body
|
||||
@@ -1,21 +1,21 @@
|
||||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://coin.gd" type="Script" id=1]
|
||||
[ext_resource path="res://coin.png" type="Texture" id=2]
|
||||
[ext_resource path="res://sound_coin.wav" type="AudioStream" id=3]
|
||||
[ext_resource path="res://bullet.png" type="Texture" id=4]
|
||||
[ext_resource path="res://coin/coin.gd" type="Script" id=1]
|
||||
[ext_resource path="res://coin/coin.png" type="Texture" id=2]
|
||||
[ext_resource path="res://audio/sound_coin.wav" type="AudioStream" id=3]
|
||||
[ext_resource path="res://player/bullet.png" type="Texture" id=4]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
|
||||
resource_name = "spin"
|
||||
length = 1.5
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ),
|
||||
@@ -24,15 +24,14 @@ tracks/0/keys = {
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
|
||||
length = 8.0
|
||||
loop = false
|
||||
step = 0.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -40,10 +39,11 @@ tracks/0/keys = {
|
||||
"values": [ 0 ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("particles:emitting")
|
||||
tracks/1/path = NodePath("Particles:emitting")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -55,6 +55,7 @@ tracks/2/path = NodePath(".")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 2.7 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -64,10 +65,11 @@ tracks/2/keys = {
|
||||
} ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("sound:playing")
|
||||
tracks/3/path = NodePath("Sound:playing")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -75,10 +77,11 @@ tracks/3/keys = {
|
||||
"values": [ true ]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/path = NodePath("sprite:self_modulate")
|
||||
tracks/4/path = NodePath("Sprite:self_modulate")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/imported = false
|
||||
tracks/4/enabled = true
|
||||
tracks/4/keys = {
|
||||
"times": PoolRealArray( 0, 0.41 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
@@ -88,142 +91,53 @@ tracks/4/keys = {
|
||||
|
||||
[sub_resource type="CircleShape2D" id=3]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
radius = 10.0
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id=4]
|
||||
|
||||
render_priority = 0
|
||||
blend_mode = 1
|
||||
light_mode = 0
|
||||
|
||||
[sub_resource type="Curve" id=5]
|
||||
|
||||
min_value = 0.0
|
||||
max_value = 1.0
|
||||
bake_resolution = 100
|
||||
_data = [ ]
|
||||
|
||||
[sub_resource type="CurveTexture" id=6]
|
||||
|
||||
width = 2048
|
||||
curve = SubResource( 5 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=7]
|
||||
|
||||
render_priority = 0
|
||||
trail_divisor = 1
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 20.0
|
||||
flag_align_y = false
|
||||
flag_rotate_y = false
|
||||
flag_disable_z = true
|
||||
spread = 45.0
|
||||
flatness = 0.0
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 1.0
|
||||
initial_velocity_random = 0.0
|
||||
angular_velocity = 0.0
|
||||
angular_velocity_random = 0.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
linear_accel = 0.0
|
||||
linear_accel_random = 0.0
|
||||
radial_accel = 0.0
|
||||
radial_accel_random = 0.0
|
||||
tangential_accel = 0.0
|
||||
tangential_accel_random = 0.0
|
||||
damping = 0.0
|
||||
damping_random = 0.0
|
||||
angle = 0.0
|
||||
angle_random = 0.0
|
||||
scale = 0.3
|
||||
scale_random = 0.0
|
||||
scale_curve = SubResource( 6 )
|
||||
color = Color( 1, 1, 1, 1 )
|
||||
hue_variation = 0.0
|
||||
hue_variation_random = 0.0
|
||||
anim_speed = 0.0
|
||||
anim_speed_random = 0.0
|
||||
anim_offset = 0.0
|
||||
anim_offset_random = 0.0
|
||||
anim_loop = false
|
||||
|
||||
[node name="coin" type="Area2D"]
|
||||
|
||||
input_pickable = true
|
||||
gravity_vec = Vector2( 0, 1 )
|
||||
gravity = 98.0
|
||||
linear_damp = 0.1
|
||||
angular_damp = 1.0
|
||||
audio_bus_override = false
|
||||
audio_bus_name = "Master"
|
||||
[node name="Coin" type="Area2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="sprite" type="Sprite" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
hframes = 4
|
||||
|
||||
[node name="anim" type="AnimationPlayer" parent="."]
|
||||
|
||||
playback_process_mode = 1
|
||||
playback_default_blend_time = 0.0
|
||||
root_node = NodePath("..")
|
||||
[node name="Anim" type="AnimationPlayer" parent="."]
|
||||
autoplay = "spin"
|
||||
anims/spin = SubResource( 1 )
|
||||
anims/taken = SubResource( 2 )
|
||||
playback/active = true
|
||||
playback/speed = 3.0
|
||||
blend_times = [ ]
|
||||
autoplay = "spin"
|
||||
|
||||
[node name="collision" type="CollisionShape2D" parent="."]
|
||||
|
||||
[node name="Collision" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="sound" type="AudioStreamPlayer2D" parent="."]
|
||||
|
||||
[node name="Sound" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 3 )
|
||||
volume_db = 0.0
|
||||
autoplay = false
|
||||
max_distance = 2000.0
|
||||
attenuation = 1.0
|
||||
bus = "Master"
|
||||
area_mask = 1
|
||||
|
||||
[node name="particles" type="Particles2D" parent="."]
|
||||
|
||||
[node name="Particles" type="Particles2D" parent="."]
|
||||
modulate = Color( 0.596863, 0.638745, 1, 1 )
|
||||
material = SubResource( 4 )
|
||||
emitting = false
|
||||
amount = 8
|
||||
lifetime = 1.0
|
||||
one_shot = true
|
||||
preprocess = 0.0
|
||||
speed_scale = 1.0
|
||||
explosiveness = 0.7
|
||||
randomness = 0.0
|
||||
fixed_fps = 0
|
||||
fract_delta = true
|
||||
visibility_rect = Rect2( -100, -100, 200, 200 )
|
||||
local_coords = true
|
||||
draw_order = 0
|
||||
process_material = SubResource( 7 )
|
||||
texture = ExtResource( 4 )
|
||||
normal_map = null
|
||||
h_frames = 1
|
||||
v_frames = 1
|
||||
|
||||
[node name="enabler" type="VisibilityEnabler2D" parent="."]
|
||||
|
||||
rect = Rect2( -10, -10, 20, 20 )
|
||||
pause_animations = true
|
||||
freeze_bodies = true
|
||||
[node name="Enabler" type="VisibilityEnabler2D" parent="."]
|
||||
pause_particles = false
|
||||
pause_animated_sprites = true
|
||||
process_parent = false
|
||||
physics_process_parent = false
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_enter"]
|
||||
|
||||
|
||||
11
2d/physics_platformer/coin/coin.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Area2D
|
||||
|
||||
class_name Coin
|
||||
|
||||
# Member variables
|
||||
var taken = false
|
||||
|
||||
|
||||
func _on_body_enter( body ):
|
||||
if not taken and body is Player:
|
||||
($Anim as AnimationPlayer).play("taken")
|
||||
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/coin.png-7e710de472b75b3653c3283ef5153eb4.stex"
|
||||
path="res://.import/coin.png-c9e5c2f51b2a10beb2d794afbbee004f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://coin.png"
|
||||
source_md5="e222f7ea0cf168c4da9b5beff4035f2c"
|
||||
|
||||
dest_files=[ "res://.import/coin.png-7e710de472b75b3653c3283ef5153eb4.stex" ]
|
||||
dest_md5="6ddc3149e946e3fc81f8d94eccdc03aa"
|
||||
source_file="res://coin/coin.png"
|
||||
dest_files=[ "res://.import/coin.png-c9e5c2f51b2a10beb2d794afbbee004f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
@@ -1,282 +0,0 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
|
||||
[ext_resource path="res://enemy.gd" type="Script" id=1]
|
||||
[ext_resource path="res://enemy.png" type="Texture" id=2]
|
||||
[ext_resource path="res://bullet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://sound_hit.wav" type="AudioStream" id=4]
|
||||
[ext_resource path="res://sound_explode.wav" type="AudioStream" id=5]
|
||||
|
||||
[sub_resource type="Animation" id=1]
|
||||
|
||||
resource_name = "explode"
|
||||
length = 6.0
|
||||
loop = false
|
||||
step = 0.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ 4 ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Particles2D:emitting")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 3.47394 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ true ]
|
||||
}
|
||||
tracks/2/type = "method"
|
||||
tracks/2/path = NodePath(".")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 3.20357, 5.07305 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"values": [ {
|
||||
"args": [ ],
|
||||
"method": "_pre_explode"
|
||||
}, {
|
||||
"args": [ ],
|
||||
"method": "_die"
|
||||
} ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("sprite:self_modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 3.55, 4.32 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
|
||||
length = 6.75
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
|
||||
resource_name = "walk"
|
||||
length = 1.25
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 2, 3, 4, 0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="CircleShape2D" id=4]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
radius = 14.0
|
||||
|
||||
[sub_resource type="Gradient" id=5]
|
||||
|
||||
offsets = PoolRealArray( 0, 0.564972, 1 )
|
||||
colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 1, 0.915254, 1, 1, 1, 0 )
|
||||
|
||||
[sub_resource type="GradientTexture" id=6]
|
||||
|
||||
gradient = SubResource( 5 )
|
||||
width = 2048
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=7]
|
||||
|
||||
render_priority = 0
|
||||
trail_divisor = 1
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 20.0
|
||||
flag_align_y = false
|
||||
flag_rotate_y = false
|
||||
flag_disable_z = true
|
||||
spread = 180.0
|
||||
flatness = 0.0
|
||||
gravity = Vector3( 0, 98, 0 )
|
||||
initial_velocity = 322.73
|
||||
initial_velocity_random = 0.0
|
||||
angular_velocity = 0.0
|
||||
angular_velocity_random = 0.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
linear_accel = 0.0
|
||||
linear_accel_random = 0.0
|
||||
radial_accel = 0.0
|
||||
radial_accel_random = 0.0
|
||||
tangential_accel = 0.0
|
||||
tangential_accel_random = 0.0
|
||||
damping = 0.0
|
||||
damping_random = 0.0
|
||||
angle = 0.0
|
||||
angle_random = 0.0
|
||||
scale = 2.4
|
||||
scale_random = 0.0
|
||||
color_ramp = SubResource( 6 )
|
||||
hue_variation = 0.0
|
||||
hue_variation_random = 0.0
|
||||
anim_speed = 0.0
|
||||
anim_speed_random = 0.0
|
||||
anim_offset = 0.0
|
||||
anim_offset_random = 0.0
|
||||
anim_loop = false
|
||||
|
||||
[node name="enemy" type="RigidBody2D"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
mode = 2
|
||||
mass = 1.0
|
||||
friction = 0.0
|
||||
bounce = 0.0
|
||||
gravity_scale = 1.0
|
||||
custom_integrator = false
|
||||
continuous_cd = 0
|
||||
contacts_reported = 4
|
||||
contact_monitor = false
|
||||
sleeping = false
|
||||
can_sleep = true
|
||||
linear_velocity = Vector2( 0, 0 )
|
||||
linear_damp = -1.0
|
||||
angular_velocity = 0.0
|
||||
angular_damp = -1.0
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="enabler" type="VisibilityEnabler2D" parent="."]
|
||||
|
||||
position = Vector2( 16.2569, 11.0034 )
|
||||
scale = Vector2( 23.5056, 10.8629 )
|
||||
rect = Rect2( -10, -10, 20, 20 )
|
||||
pause_animations = true
|
||||
freeze_bodies = true
|
||||
pause_particles = false
|
||||
pause_animated_sprites = true
|
||||
process_parent = false
|
||||
physics_process_parent = false
|
||||
|
||||
[node name="anim" type="AnimationPlayer" parent="."]
|
||||
|
||||
playback_process_mode = 1
|
||||
playback_default_blend_time = 0.0
|
||||
root_node = NodePath("..")
|
||||
anims/explode = SubResource( 1 )
|
||||
anims/idle = SubResource( 2 )
|
||||
anims/walk = SubResource( 3 )
|
||||
playback/active = true
|
||||
playback/speed = 3.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[node name="sprite" type="Sprite" parent="."]
|
||||
|
||||
texture = ExtResource( 2 )
|
||||
hframes = 8
|
||||
frame = 4
|
||||
|
||||
[node name="shape1" type="CollisionShape2D" parent="."]
|
||||
|
||||
position = Vector2( -1.08072, -2.16144 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[node name="shape2" type="CollisionShape2D" parent="."]
|
||||
|
||||
position = Vector2( 6.48431, 3.24216 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[node name="shape3" type="CollisionShape2D" parent="."]
|
||||
|
||||
position = Vector2( -12.495, 3.53415 )
|
||||
shape = SubResource( 4 )
|
||||
|
||||
[node name="raycast_left" type="RayCast2D" parent="."]
|
||||
|
||||
position = Vector2( -33.2868, -9.34363 )
|
||||
enabled = true
|
||||
exclude_parent = true
|
||||
cast_to = Vector2( 0, 45 )
|
||||
collision_mask = 1
|
||||
type_mask = 15
|
||||
|
||||
[node name="raycast_right" type="RayCast2D" parent="."]
|
||||
|
||||
position = Vector2( 29.1987, -9.34363 )
|
||||
enabled = true
|
||||
exclude_parent = true
|
||||
cast_to = Vector2( 0, 45 )
|
||||
collision_mask = 1
|
||||
type_mask = 15
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
|
||||
modulate = Color( 1, 1, 1, 0.685843 )
|
||||
emitting = false
|
||||
amount = 8
|
||||
lifetime = 0.5
|
||||
one_shot = true
|
||||
preprocess = 0.0
|
||||
speed_scale = 1.0
|
||||
explosiveness = 0.86
|
||||
randomness = 0.0
|
||||
fixed_fps = 0
|
||||
fract_delta = true
|
||||
visibility_rect = Rect2( -100, -100, 200, 200 )
|
||||
local_coords = true
|
||||
draw_order = 4
|
||||
process_material = SubResource( 7 )
|
||||
texture = ExtResource( 3 )
|
||||
normal_map = null
|
||||
h_frames = 1
|
||||
v_frames = 1
|
||||
|
||||
[node name="sound_hit" type="AudioStreamPlayer2D" parent="."]
|
||||
|
||||
stream = ExtResource( 4 )
|
||||
volume_db = 0.0
|
||||
autoplay = false
|
||||
max_distance = 2000.0
|
||||
attenuation = 1.0
|
||||
bus = "Master"
|
||||
area_mask = 1
|
||||
|
||||
[node name="sound_explode" type="AudioStreamPlayer2D" parent="."]
|
||||
|
||||
stream = ExtResource( 5 )
|
||||
volume_db = 0.0
|
||||
autoplay = false
|
||||
max_distance = 2000.0
|
||||
attenuation = 1.0
|
||||
bus = "Master"
|
||||
area_mask = 1
|
||||
|
||||
|
||||
183
2d/physics_platformer/enemy/Enemy.tscn
Normal file
@@ -0,0 +1,183 @@
|
||||
[gd_scene load_steps=14 format=2]
|
||||
|
||||
[ext_resource path="res://enemy/enemy.gd" type="Script" id=1]
|
||||
[ext_resource path="res://enemy/enemy.png" type="Texture" id=2]
|
||||
[ext_resource path="res://player/bullet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://audio/sound_hit.wav" type="AudioStream" id=4]
|
||||
[ext_resource path="res://audio/sound_explode.wav" type="AudioStream" id=5]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id=1]
|
||||
friction = 0.0
|
||||
|
||||
[sub_resource type="Animation" id=2]
|
||||
length = 6.0
|
||||
step = 0.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ 4 ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Particles2D:emitting")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 3.47394 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ true ]
|
||||
}
|
||||
tracks/2/type = "method"
|
||||
tracks/2/path = NodePath(".")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 3.20357, 5.07305 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"values": [ {
|
||||
"args": [ ],
|
||||
"method": "_pre_explode"
|
||||
}, {
|
||||
"args": [ ],
|
||||
"method": "_die"
|
||||
} ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("Sprite:self_modulate")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 3.55, 4.32 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=3]
|
||||
length = 6.75
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
length = 1.25
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
"update": 1,
|
||||
"values": [ 0, 1, 2, 3, 4, 0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="CircleShape2D" id=5]
|
||||
radius = 14.0
|
||||
|
||||
[sub_resource type="Gradient" id=6]
|
||||
offsets = PoolRealArray( 0, 0.564972, 1 )
|
||||
colors = PoolColorArray( 1, 1, 1, 1, 1, 1, 1, 0.915254, 1, 1, 1, 0 )
|
||||
|
||||
[sub_resource type="GradientTexture" id=7]
|
||||
gradient = SubResource( 6 )
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=8]
|
||||
emission_shape = 1
|
||||
emission_sphere_radius = 20.0
|
||||
flag_disable_z = true
|
||||
spread = 180.0
|
||||
gravity = Vector3( 0, 98, 0 )
|
||||
initial_velocity = 322.73
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
scale = 2.4
|
||||
color_ramp = SubResource( 7 )
|
||||
|
||||
[node name="Enemy" type="RigidBody2D"]
|
||||
mode = 2
|
||||
physics_material_override = SubResource( 1 )
|
||||
contacts_reported = 4
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Enabler" type="VisibilityEnabler2D" parent="."]
|
||||
position = Vector2( 16.2569, 11.0034 )
|
||||
scale = Vector2( 23.5056, 10.8629 )
|
||||
pause_particles = false
|
||||
|
||||
[node name="Anim" type="AnimationPlayer" parent="."]
|
||||
anims/explode = SubResource( 2 )
|
||||
anims/idle = SubResource( 3 )
|
||||
anims/walk = SubResource( 4 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
hframes = 8
|
||||
frame = 4
|
||||
|
||||
[node name="Shape1" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -1.08072, -2.16144 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="Shape2" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 6.48431, 3.24216 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="Shape3" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( -12.495, 3.53415 )
|
||||
shape = SubResource( 5 )
|
||||
|
||||
[node name="RaycastLeft" type="RayCast2D" parent="."]
|
||||
position = Vector2( -33.2868, -9.34363 )
|
||||
enabled = true
|
||||
cast_to = Vector2( 0, 45 )
|
||||
|
||||
[node name="RaycastRight" type="RayCast2D" parent="."]
|
||||
position = Vector2( 29.1987, -9.34363 )
|
||||
enabled = true
|
||||
cast_to = Vector2( 0, 45 )
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
modulate = Color( 1, 1, 1, 0.685843 )
|
||||
emitting = false
|
||||
lifetime = 0.5
|
||||
one_shot = true
|
||||
explosiveness = 0.86
|
||||
draw_order = 4
|
||||
process_material = SubResource( 8 )
|
||||
texture = ExtResource( 3 )
|
||||
|
||||
[node name="SoundHit" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 4 )
|
||||
|
||||
[node name="SoundExplode" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 5 )
|
||||
|
||||
@@ -1,36 +1,45 @@
|
||||
extends RigidBody2D
|
||||
|
||||
class_name Enemy
|
||||
|
||||
# Member variables
|
||||
const WALK_SPEED = 50
|
||||
const STATE_WALKING = 0
|
||||
const STATE_DYING = 1
|
||||
|
||||
# state machine
|
||||
var state = STATE_WALKING
|
||||
|
||||
var direction = -1
|
||||
var anim = ""
|
||||
|
||||
onready var rc_left = $raycast_left
|
||||
onready var rc_right = $raycast_right
|
||||
onready var rc_left = $RaycastLeft
|
||||
onready var rc_right = $RaycastRight
|
||||
|
||||
var WALK_SPEED = 50
|
||||
|
||||
var bullet_class = preload("res://bullet.gd")
|
||||
var Bullet = preload("res://player/bullet.gd")
|
||||
|
||||
|
||||
func _die():
|
||||
queue_free()
|
||||
|
||||
|
||||
func _pre_explode():
|
||||
#make sure nothing collides against this
|
||||
$shape1.queue_free()
|
||||
$shape2.queue_free()
|
||||
$shape3.queue_free()
|
||||
$Shape1.queue_free()
|
||||
$Shape2.queue_free()
|
||||
$Shape3.queue_free()
|
||||
|
||||
# Stay there
|
||||
mode = MODE_STATIC
|
||||
$sound_explode.play()
|
||||
|
||||
($SoundExplode as AudioStreamPlayer2D).play()
|
||||
|
||||
func _bullet_collider(cc, s, dp):
|
||||
mode = MODE_RIGID
|
||||
state = STATE_DYING
|
||||
|
||||
s.set_angular_velocity(sign(dp.x) * 33.0)
|
||||
set_friction(1)
|
||||
cc.disable()
|
||||
($SoundHit as AudioStreamPlayer2D).play()
|
||||
|
||||
func _integrate_forces(s):
|
||||
var lv = s.get_linear_velocity()
|
||||
@@ -48,14 +57,9 @@ func _integrate_forces(s):
|
||||
var dp = s.get_contact_local_normal(i)
|
||||
|
||||
if cc:
|
||||
if cc is bullet_class and not cc.disabled:
|
||||
mode = MODE_RIGID
|
||||
state = STATE_DYING
|
||||
#lv = s.get_contact_local_normal(i) * 400
|
||||
s.set_angular_velocity(sign(dp.x) * 33.0)
|
||||
set_friction(1)
|
||||
cc.disable()
|
||||
$sound_hit.play()
|
||||
if cc is Bullet and not cc.disabled:
|
||||
# enqueue call
|
||||
call_deferred("_bullet_collider", cc, s, dp)
|
||||
break
|
||||
|
||||
if dp.x > 0.9:
|
||||
@@ -65,18 +69,18 @@ func _integrate_forces(s):
|
||||
|
||||
if wall_side != 0 and wall_side != direction:
|
||||
direction = -direction
|
||||
$sprite.scale.x = -direction
|
||||
($Sprite as Sprite).scale.x = -direction
|
||||
if direction < 0 and not rc_left.is_colliding() and rc_right.is_colliding():
|
||||
direction = -direction
|
||||
$sprite.scale.x = -direction
|
||||
($Sprite as Sprite).scale.x = -direction
|
||||
elif direction > 0 and not rc_right.is_colliding() and rc_left.is_colliding():
|
||||
direction = -direction
|
||||
$sprite.scale.x = -direction
|
||||
($Sprite as Sprite).scale.x = -direction
|
||||
|
||||
lv.x = direction * WALK_SPEED
|
||||
|
||||
if anim != new_anim:
|
||||
anim = new_anim
|
||||
$anim.play(anim)
|
||||
($Anim as AnimationPlayer).play(anim)
|
||||
|
||||
s.set_linear_velocity(lv)
|
||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/enemy.png-f7d9f81714867a24a08e299bb600e611.stex"
|
||||
path="res://.import/enemy.png-1891d9038eeed672a2459bc4e7db5910.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://enemy.png"
|
||||
source_md5="42bb3a8005fffb91c993fbb55e798d1d"
|
||||
|
||||
dest_files=[ "res://.import/enemy.png-f7d9f81714867a24a08e299bb600e611.stex" ]
|
||||
dest_md5="4c8d1da721e96b61e14085c6dad3a986"
|
||||
source_file="res://enemy/enemy.png"
|
||||
dest_files=[ "res://.import/enemy.png-1891d9038eeed672a2459bc4e7db5910.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
@@ -3,20 +3,21 @@
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.png"
|
||||
source_md5="059cf00427ccbf40878c582845360337"
|
||||
|
||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
|
||||
dest_md5="b775640cb5a1f03d40f18d355dddd188"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://moving_platform.gd" type="Script" id=1]
|
||||
[ext_resource path="res://moving_platform.png" type="Texture" id=2]
|
||||
|
||||
[node name="moving_platform" type="Node2D"]
|
||||
|
||||
script = ExtResource( 1 )
|
||||
motion = Vector2( 0, 0 )
|
||||
cycle = 1.0
|
||||
|
||||
[node name="platform" type="RigidBody2D" parent="."]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
mode = 3
|
||||
mass = 1.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
|
||||
linear_velocity = Vector2( 0, 0 )
|
||||
linear_damp = -1.0
|
||||
angular_velocity = 0.0
|
||||
angular_damp = -1.0
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="platform"]
|
||||
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -88, -24, 88, -24, 88, 24, -88, 24 )
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="ogg_vorbis"
|
||||
type="AudioStreamOGGVorbis"
|
||||
path="res://.import/music.ogg-3bd46d3a4b41702b152014078d12a390.oggstr"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://music.ogg"
|
||||
source_md5="ac01d521c92ce9d01cf09826bd3addbf"
|
||||
|
||||
dest_files=[ "res://.import/music.ogg-3bd46d3a4b41702b152014078d12a390.oggstr" ]
|
||||
dest_md5="8f49ec9ebb932a81e74cb040e2a26d5f"
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0
|
||||
@@ -1,30 +0,0 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://one_way_platform.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
extents = Vector2( 100, 10 )
|
||||
|
||||
[node name="one_way_platform" type="StaticBody2D"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="sprite" type="Sprite" parent="."]
|
||||
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
||||
position = Vector2( 1.46304, -13.1672 )
|
||||
shape = SubResource( 1 )
|
||||
one_way_collision = true
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.stex"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://osb_right.png"
|
||||
source_md5="860560d5e66ccd837973fbbde7eb958f"
|
||||
|
||||
dest_files=[ "res://.import/osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.stex" ]
|
||||
dest_md5="79b739823ce27077acfa70f6330fedd6"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
@@ -1,103 +0,0 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://scroll_bg_sky.png" type="Texture" id=1]
|
||||
[ext_resource path="res://scroll_bg_cloud_1.png" type="Texture" id=2]
|
||||
[ext_resource path="res://scroll_bg_cloud_2.png" type="Texture" id=3]
|
||||
[ext_resource path="res://scroll_bg_cloud_3.png" type="Texture" id=4]
|
||||
[ext_resource path="res://scroll_bg_fg_2.png" type="Texture" id=5]
|
||||
[ext_resource path="res://scroll_bg_fg_1.png" type="Texture" id=6]
|
||||
|
||||
[node name="parallax_bg" type="ParallaxBackground"]
|
||||
|
||||
layer = -1
|
||||
offset = Vector2( 0, 0 )
|
||||
rotation = 0.0
|
||||
scale = Vector2( 1, 1 )
|
||||
scroll_offset = Vector2( 0, 0 )
|
||||
scroll_base_offset = Vector2( 0, 0 )
|
||||
scroll_base_scale = Vector2( 0.7, 0 )
|
||||
scroll_limit_begin = Vector2( 0, 0 )
|
||||
scroll_limit_end = Vector2( 0, 0 )
|
||||
scroll_ignore_camera_zoom = false
|
||||
|
||||
[node name="sky" type="ParallaxLayer" parent="."]
|
||||
|
||||
motion_scale = Vector2( 1, 1 )
|
||||
motion_offset = Vector2( 0, 0 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="sky"]
|
||||
|
||||
scale = Vector2( 32, 0.94 )
|
||||
texture = ExtResource( 1 )
|
||||
centered = false
|
||||
|
||||
[node name="clouds" type="ParallaxLayer" parent="."]
|
||||
|
||||
motion_scale = Vector2( 0.1, 1 )
|
||||
motion_offset = Vector2( 0, 0 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="clouds"]
|
||||
|
||||
position = Vector2( 28, 127 )
|
||||
texture = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite 2" type="Sprite" parent="clouds"]
|
||||
|
||||
position = Vector2( 404, 24 )
|
||||
texture = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite 3" type="Sprite" parent="clouds"]
|
||||
|
||||
position = Vector2( 154, 46 )
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite 4" type="Sprite" parent="clouds"]
|
||||
|
||||
position = Vector2( 525, 130 )
|
||||
texture = ExtResource( 3 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite 5" type="Sprite" parent="clouds"]
|
||||
|
||||
position = Vector2( 255, 158 )
|
||||
texture = ExtResource( 4 )
|
||||
centered = false
|
||||
|
||||
[node name="Sprite 6" type="Sprite" parent="clouds"]
|
||||
|
||||
position = Vector2( 674, 70 )
|
||||
texture = ExtResource( 4 )
|
||||
centered = false
|
||||
|
||||
[node name="mount_ 2" type="ParallaxLayer" parent="."]
|
||||
|
||||
motion_scale = Vector2( 0.2, 1 )
|
||||
motion_offset = Vector2( 0, 0 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="mount_ 2"]
|
||||
|
||||
position = Vector2( 0, 225 )
|
||||
texture = ExtResource( 5 )
|
||||
centered = false
|
||||
region_rect = Rect2( 0, 0, 800, 256 )
|
||||
|
||||
[node name="mount_1" type="ParallaxLayer" parent="."]
|
||||
|
||||
motion_scale = Vector2( 0.4, 1 )
|
||||
motion_offset = Vector2( 0, 0 )
|
||||
motion_mirroring = Vector2( 800, 0 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="mount_1"]
|
||||
|
||||
position = Vector2( 0, 225 )
|
||||
texture = ExtResource( 6 )
|
||||
centered = false
|
||||
region_rect = Rect2( 0, 0, 800, 256 )
|
||||
|
||||
|
||||
17
2d/physics_platformer/platform/MovingPlatform.tscn
Normal file
@@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://platform/moving_platform.gd" type="Script" id=1]
|
||||
[ext_resource path="res://platform/moving_platform.png" type="Texture" id=2]
|
||||
|
||||
[node name="Moving_platform" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Platform" type="RigidBody2D" parent="."]
|
||||
mode = 3
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="Platform"]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Platform"]
|
||||
polygon = PoolVector2Array( -88, -24, 88, -24, 88, 24, -88, 24 )
|
||||
|
||||
17
2d/physics_platformer/platform/OneWayPlatform.tscn
Normal file
@@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://platform/one_way_platform.png" type="Texture" id=1]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
extents = Vector2( 100, 10 )
|
||||
|
||||
[node name="One_way_platform" type="StaticBody2D"]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 1.46304, -13.1672 )
|
||||
shape = SubResource( 1 )
|
||||
one_way_collision = true
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
extends Node2D
|
||||
|
||||
class_name MovingPlatform
|
||||
|
||||
# Member variables
|
||||
export var motion = Vector2()
|
||||
export var cycle = 1.0
|
||||
|
||||
var accum = 0.0
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
accum += delta * (1.0 / cycle) * PI * 2.0
|
||||
accum = fmod(accum, PI * 2.0)
|
||||
|
||||
var d = sin(accum)
|
||||
var xf = Transform2D()
|
||||
|
||||
xf[2]= motion * d
|
||||
$platform.transform = xf
|
||||
($Platform as RigidBody2D).transform = xf
|
||||
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/moving_platform.png-1ef2f9fd1684df90d6ad38a267c1201b.stex"
|
||||
path="res://.import/moving_platform.png-7e92061cd93e8b0235df711d3782cd8c.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://moving_platform.png"
|
||||
source_md5="3a3eb41985ca94372fe4a9c81b067504"
|
||||
|
||||
dest_files=[ "res://.import/moving_platform.png-1ef2f9fd1684df90d6ad38a267c1201b.stex" ]
|
||||
dest_md5="2d28d040ea69e01af7f8d176520661b0"
|
||||
source_file="res://platform/moving_platform.png"
|
||||
dest_files=[ "res://.import/moving_platform.png-7e92061cd93e8b0235df711d3782cd8c.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/one_way_platform.png-af40161497fd0e8bfbc5d400c8bd650a.stex"
|
||||
path="res://.import/one_way_platform.png-2865772e209813c1636a14aee8d019a3.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://one_way_platform.png"
|
||||
source_md5="6232db3f22a3599440102f32eb01edca"
|
||||
|
||||
dest_files=[ "res://.import/one_way_platform.png-af40161497fd0e8bfbc5d400c8bd650a.stex" ]
|
||||
dest_md5="4a0e87dfa4f589f6fead720035abedca"
|
||||
source_file="res://platform/one_way_platform.png"
|
||||
dest_files=[ "res://.import/one_way_platform.png-2865772e209813c1636a14aee8d019a3.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
86
2d/physics_platformer/player/Bullet.tscn
Normal file
@@ -0,0 +1,86 @@
|
||||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://player/bullet.gd" type="Script" id=1]
|
||||
[ext_resource path="res://player/bullet.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id=1]
|
||||
blend_mode = 1
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=2]
|
||||
flag_disable_z = true
|
||||
spread = 0.0
|
||||
gravity = Vector3( 0, 0, 0 )
|
||||
initial_velocity = 1.0
|
||||
angular_velocity = 38.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
scale = 0.8
|
||||
|
||||
[sub_resource type="CircleShape2D" id=3]
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
length = 1.5
|
||||
tracks/0/type = "method"
|
||||
tracks/0/path = NodePath(".")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 1.31 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"values": [ {
|
||||
"args": [ ],
|
||||
"method": "queue_free"
|
||||
} ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("Sprite:modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/keys = {
|
||||
"times": PoolRealArray( 0, 1.03 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("Particles2D:self_modulate")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/keys = {
|
||||
"times": PoolRealArray( 0, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1 ),
|
||||
"update": 0,
|
||||
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
|
||||
}
|
||||
|
||||
[node name="Bullet" type="RigidBody2D"]
|
||||
continuous_cd = 2
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
material = SubResource( 1 )
|
||||
lifetime = 0.3
|
||||
speed_scale = 3.0
|
||||
local_coords = false
|
||||
process_material = SubResource( 2 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource( 3 )
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
one_shot = true
|
||||
|
||||
[node name="Anim" type="AnimationPlayer" parent="."]
|
||||
anims/shutdown = SubResource( 4 )
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="disable"]
|
||||
@@ -1,73 +1,46 @@
|
||||
[gd_scene load_steps=24 format=2]
|
||||
[gd_scene load_steps=25 format=2]
|
||||
|
||||
[ext_resource path="res://player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://robot_demo.png" type="Texture" id=2]
|
||||
[ext_resource path="res://bullet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://osb_left.png" type="Texture" id=4]
|
||||
[ext_resource path="res://osb_right.png" type="Texture" id=5]
|
||||
[ext_resource path="res://osb_jump.png" type="Texture" id=6]
|
||||
[ext_resource path="res://osb_fire.png" type="Texture" id=7]
|
||||
[ext_resource path="res://sound_shoot.wav" type="AudioStream" id=8]
|
||||
[ext_resource path="res://sound_jump.wav" type="AudioStream" id=9]
|
||||
[ext_resource path="res://player/player.gd" type="Script" id=1]
|
||||
[ext_resource path="res://player/robot_demo.png" type="Texture" id=2]
|
||||
[ext_resource path="res://player/bullet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://player/osb_left.png" type="Texture" id=4]
|
||||
[ext_resource path="res://player/osb_right.png" type="Texture" id=5]
|
||||
[ext_resource path="res://player/osb_jump.png" type="Texture" id=6]
|
||||
[ext_resource path="res://player/osb_fire.png" type="Texture" id=7]
|
||||
[ext_resource path="res://audio/sound_shoot.wav" type="AudioStream" id=8]
|
||||
[ext_resource path="res://audio/sound_jump.wav" type="AudioStream" id=9]
|
||||
|
||||
[sub_resource type="Gradient" id=1]
|
||||
[sub_resource type="PhysicsMaterial" id=1]
|
||||
friction = 0.0
|
||||
|
||||
offsets = PoolRealArray( 0, 1 )
|
||||
[sub_resource type="Gradient" id=2]
|
||||
colors = PoolColorArray( 0.708353, 0.72498, 1, 1, 1, 1, 1, 0 )
|
||||
|
||||
[sub_resource type="GradientTexture" id=2]
|
||||
[sub_resource type="GradientTexture" id=3]
|
||||
gradient = SubResource( 2 )
|
||||
|
||||
gradient = SubResource( 1 )
|
||||
width = 2048
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=3]
|
||||
|
||||
render_priority = 0
|
||||
trail_divisor = 1
|
||||
emission_shape = 0
|
||||
flag_align_y = false
|
||||
flag_rotate_y = false
|
||||
[sub_resource type="ParticlesMaterial" id=4]
|
||||
flag_disable_z = true
|
||||
spread = 65.84
|
||||
flatness = 0.0
|
||||
gravity = Vector3( 0, -15, 0 )
|
||||
initial_velocity = 10.14
|
||||
initial_velocity_random = 0.0
|
||||
angular_velocity = 200.0
|
||||
angular_velocity_random = 1.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
linear_accel = 100.0
|
||||
linear_accel_random = 0.0
|
||||
radial_accel = 0.0
|
||||
radial_accel_random = 0.0
|
||||
tangential_accel = 0.0
|
||||
tangential_accel_random = 0.0
|
||||
damping = 0.0
|
||||
damping_random = 0.0
|
||||
angle = 0.0
|
||||
angle_random = 0.0
|
||||
scale = 1.0
|
||||
scale_random = 0.0
|
||||
color_ramp = SubResource( 2 )
|
||||
hue_variation = 0.0
|
||||
hue_variation_random = 0.0
|
||||
anim_speed = 0.0
|
||||
anim_speed_random = 0.0
|
||||
anim_offset = 0.0
|
||||
anim_offset_random = 0.0
|
||||
anim_loop = false
|
||||
|
||||
[sub_resource type="Animation" id=4]
|
||||
color_ramp = SubResource( 3 )
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
length = 0.01
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -75,16 +48,16 @@ tracks/0/keys = {
|
||||
"values": [ 22 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=5]
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
length = 0.01
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -92,16 +65,16 @@ tracks/0/keys = {
|
||||
"values": [ 21 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=6]
|
||||
|
||||
[sub_resource type="Animation" id=7]
|
||||
length = 0.5
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -109,16 +82,16 @@ tracks/0/keys = {
|
||||
"values": [ 26 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=7]
|
||||
|
||||
[sub_resource type="Animation" id=8]
|
||||
length = 7.0
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 1.25, 1.5, 2, 4.5, 4.75, 5, 5.25 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1 ),
|
||||
@@ -126,16 +99,16 @@ tracks/0/keys = {
|
||||
"values": [ 16, 17, 18, 16, 19, 20, 19, 16 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=8]
|
||||
|
||||
[sub_resource type="Animation" id=9]
|
||||
length = 0.5
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -143,16 +116,16 @@ tracks/0/keys = {
|
||||
"values": [ 25 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=9]
|
||||
|
||||
[sub_resource type="Animation" id=10]
|
||||
length = 0.5
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1 ),
|
||||
@@ -160,16 +133,16 @@ tracks/0/keys = {
|
||||
"values": [ 23, 24, 23 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=10]
|
||||
|
||||
[sub_resource type="Animation" id=11]
|
||||
length = 0.5
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
@@ -177,16 +150,16 @@ tracks/0/keys = {
|
||||
"values": [ 26 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=11]
|
||||
|
||||
[sub_resource type="Animation" id=12]
|
||||
length = 1.25
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
@@ -194,16 +167,16 @@ tracks/0/keys = {
|
||||
"values": [ 0, 1, 2, 3, 4, 0 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=12]
|
||||
|
||||
[sub_resource type="Animation" id=13]
|
||||
length = 1.25
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
@@ -211,16 +184,16 @@ tracks/0/keys = {
|
||||
"values": [ 5, 6, 7, 8, 9, 5 ]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id=13]
|
||||
|
||||
[sub_resource type="Animation" id=14]
|
||||
length = 1.25
|
||||
loop = true
|
||||
step = 0.25
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("sprite:frame")
|
||||
tracks/0/path = NodePath("Sprite:frame")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/keys = {
|
||||
"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ),
|
||||
"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ),
|
||||
@@ -228,202 +201,99 @@ tracks/0/keys = {
|
||||
"values": [ 10, 11, 12, 13, 14, 5 ]
|
||||
}
|
||||
|
||||
[sub_resource type="RayShape2D" id=14]
|
||||
|
||||
[sub_resource type="RayShape2D" id=15]
|
||||
custom_solver_bias = 0.5
|
||||
length = 20.0
|
||||
|
||||
[node name="player" type="RigidBody2D"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
[node name="Player" type="RigidBody2D"]
|
||||
mode = 2
|
||||
mass = 3.0
|
||||
friction = 0.0
|
||||
bounce = 0.0
|
||||
gravity_scale = 1.0
|
||||
physics_material_override = SubResource( 1 )
|
||||
custom_integrator = true
|
||||
continuous_cd = 0
|
||||
contacts_reported = 3
|
||||
contact_monitor = false
|
||||
sleeping = false
|
||||
can_sleep = true
|
||||
linear_velocity = Vector2( 0, 0 )
|
||||
linear_damp = -1.0
|
||||
angular_velocity = 0.0
|
||||
angular_damp = -1.0
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="sprite" type="Sprite" parent="."]
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
vframes = 2
|
||||
hframes = 16
|
||||
|
||||
[node name="smoke" type="Particles2D" parent="sprite"]
|
||||
|
||||
[node name="Smoke" type="Particles2D" parent="Sprite"]
|
||||
self_modulate = Color( 1, 1, 1, 0.26702 )
|
||||
position = Vector2( 20.7312, 3.21187 )
|
||||
rotation = -1.45648
|
||||
emitting = true
|
||||
amount = 8
|
||||
emitting = false
|
||||
lifetime = 0.3
|
||||
one_shot = true
|
||||
preprocess = 0.0
|
||||
speed_scale = 1.0
|
||||
explosiveness = 1.0
|
||||
randomness = 0.0
|
||||
fixed_fps = 0
|
||||
fract_delta = true
|
||||
visibility_rect = Rect2( -100, -100, 200, 200 )
|
||||
local_coords = false
|
||||
draw_order = 97
|
||||
process_material = SubResource( 3 )
|
||||
process_material = SubResource( 4 )
|
||||
texture = ExtResource( 3 )
|
||||
normal_map = null
|
||||
h_frames = 1
|
||||
v_frames = 1
|
||||
|
||||
[node name="anim" type="AnimationPlayer" parent="."]
|
||||
[node name="Anim" type="AnimationPlayer" parent="."]
|
||||
anims/crouch = SubResource( 5 )
|
||||
anims/falling = SubResource( 6 )
|
||||
anims/falling_weapon = SubResource( 7 )
|
||||
anims/idle = SubResource( 8 )
|
||||
anims/idle_weapon = SubResource( 9 )
|
||||
anims/jumping = SubResource( 10 )
|
||||
anims/jumping_weapon = SubResource( 11 )
|
||||
anims/run = SubResource( 12 )
|
||||
anims/run_weapon = SubResource( 13 )
|
||||
anims/standing_weapon_ready = SubResource( 14 )
|
||||
|
||||
playback_process_mode = 1
|
||||
playback_default_blend_time = 0.0
|
||||
root_node = NodePath("..")
|
||||
anims/crouch = SubResource( 4 )
|
||||
anims/falling = SubResource( 5 )
|
||||
anims/falling_weapon = SubResource( 6 )
|
||||
anims/idle = SubResource( 7 )
|
||||
anims/idle_weapon = SubResource( 8 )
|
||||
anims/jumping = SubResource( 9 )
|
||||
anims/jumping_weapon = SubResource( 10 )
|
||||
anims/run = SubResource( 11 )
|
||||
anims/run_weapon = SubResource( 12 )
|
||||
anims/standing_weapon_ready = SubResource( 13 )
|
||||
playback/active = true
|
||||
playback/speed = 2.0
|
||||
blend_times = [ ]
|
||||
autoplay = ""
|
||||
|
||||
[node name="camera" type="Camera2D" parent="."]
|
||||
|
||||
anchor_mode = 1
|
||||
rotating = false
|
||||
[node name="Camera" type="Camera2D" parent="."]
|
||||
current = true
|
||||
zoom = Vector2( 1, 1 )
|
||||
limit_left = 0
|
||||
limit_top = 0
|
||||
limit_right = 10000000
|
||||
limit_bottom = 10000000
|
||||
limit_smoothed = false
|
||||
drag_margin_h_enabled = true
|
||||
drag_margin_v_enabled = true
|
||||
smoothing_enabled = 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
|
||||
editor_draw_screen = true
|
||||
editor_draw_limits = false
|
||||
editor_draw_drag_margin = false
|
||||
|
||||
[node name="bullet_shoot" type="Position2D" parent="."]
|
||||
|
||||
[node name="BulletShoot" type="Position2D" parent="."]
|
||||
position = Vector2( 31.2428, 4.08784 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
||||
position = Vector2( 0.291992, -12.1587 )
|
||||
scale = Vector2( 1, 1.76469 )
|
||||
shape = SubResource( 14 )
|
||||
shape = SubResource( 15 )
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -0.138023, 16.5036, -19.902, -24.8691, 19.3625, -24.6056 )
|
||||
|
||||
[node name="ui" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
layer = 0
|
||||
offset = Vector2( 0, 0 )
|
||||
rotation = 0.0
|
||||
scale = Vector2( 1, 1 )
|
||||
|
||||
[node name="left" type="TouchScreenButton" parent="ui"]
|
||||
|
||||
[node name="Left" type="TouchScreenButton" parent="UI"]
|
||||
position = Vector2( 27.7593, 360.87 )
|
||||
scale = Vector2( 1.49157, 1.46265 )
|
||||
normal = ExtResource( 4 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
shape_centered = true
|
||||
shape_visible = true
|
||||
passby_press = true
|
||||
action = "move_left"
|
||||
visibility_mode = 1
|
||||
|
||||
[node name="right" type="TouchScreenButton" parent="ui"]
|
||||
|
||||
[node name="Right" type="TouchScreenButton" parent="UI"]
|
||||
position = Vector2( 121.542, 361.415 )
|
||||
scale = Vector2( 1.49157, 1.46265 )
|
||||
normal = ExtResource( 5 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
shape_centered = true
|
||||
shape_visible = true
|
||||
passby_press = true
|
||||
action = "move_right"
|
||||
visibility_mode = 1
|
||||
|
||||
[node name="jump" type="TouchScreenButton" parent="ui"]
|
||||
|
||||
[node name="Jump" type="TouchScreenButton" parent="UI"]
|
||||
position = Vector2( 666.224, 359.02 )
|
||||
scale = Vector2( 1.49157, 1.46265 )
|
||||
normal = ExtResource( 6 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
shape_centered = true
|
||||
shape_visible = true
|
||||
passby_press = false
|
||||
action = "jump"
|
||||
visibility_mode = 1
|
||||
|
||||
[node name="fire" type="TouchScreenButton" parent="ui"]
|
||||
|
||||
[node name="Fire" type="TouchScreenButton" parent="UI"]
|
||||
position = Vector2( 668.073, 262.788 )
|
||||
scale = Vector2( 1.49157, 1.46265 )
|
||||
normal = ExtResource( 7 )
|
||||
pressed = null
|
||||
bitmask = null
|
||||
shape = null
|
||||
shape_centered = true
|
||||
shape_visible = true
|
||||
passby_press = false
|
||||
action = "shoot"
|
||||
visibility_mode = 1
|
||||
|
||||
[node name="sound_shoot" type="AudioStreamPlayer2D" parent="."]
|
||||
|
||||
[node name="SoundShoot" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 8 )
|
||||
volume_db = 0.0
|
||||
autoplay = false
|
||||
max_distance = 2000.0
|
||||
attenuation = 1.0
|
||||
bus = "Master"
|
||||
area_mask = 1
|
||||
|
||||
[node name="sound_jump" type="AudioStreamPlayer2D" parent="."]
|
||||
|
||||
[node name="SoundJump" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource( 9 )
|
||||
volume_db = 0.0
|
||||
autoplay = false
|
||||
max_distance = 2000.0
|
||||
attenuation = 1.0
|
||||
bus = "Master"
|
||||
area_mask = 1
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
extends RigidBody2D
|
||||
|
||||
class_name Bullet
|
||||
|
||||
# Member variables
|
||||
var disabled = false
|
||||
|
||||
|
||||
func _ready():
|
||||
($Timer as Timer).start()
|
||||
|
||||
func disable():
|
||||
if disabled:
|
||||
return
|
||||
$anim.play("shutdown")
|
||||
disabled = true
|
||||
|
||||
|
||||
func _ready():
|
||||
$Timer.start()
|
||||
|
||||
($Anim as AnimationPlayer).play("shutdown")
|
||||
disabled = true
|
||||
|
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex"
|
||||
path="res://.import/bullet.png-5615cb9904aab8db60fe6f48e996475f.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://bullet.png"
|
||||
source_md5="9fe43d82e09598fc96be75bcf60df249"
|
||||
|
||||
dest_files=[ "res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex" ]
|
||||
dest_md5="04684b9a0276f89c616678cf4489b76d"
|
||||
source_file="res://player/bullet.png"
|
||||
dest_files=[ "res://.import/bullet.png-5615cb9904aab8db60fe6f48e996475f.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/osb_left.png-fc7230aeb0eec74933ed08f89b893288.stex"
|
||||
path="res://.import/osb_fire.png-67a49910acd764fd7c67429af0ad5cb8.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://osb_left.png"
|
||||
source_md5="ce066828ec6ef27c9ce3809341574058"
|
||||
|
||||
dest_files=[ "res://.import/osb_left.png-fc7230aeb0eec74933ed08f89b893288.stex" ]
|
||||
dest_md5="197f26385b7f1c41c11b5d8356744c09"
|
||||
source_file="res://player/osb_fire.png"
|
||||
dest_files=[ "res://.import/osb_fire.png-67a49910acd764fd7c67429af0ad5cb8.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.stex"
|
||||
path="res://.import/osb_jump.png-0d4d2b2d1a7d2c11e3e4fd800b8589ed.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://osb_jump.png"
|
||||
source_md5="ac3e3adf52903de07cff73354f63896c"
|
||||
|
||||
dest_files=[ "res://.import/osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.stex" ]
|
||||
dest_md5="1c8fb76688922e0a92945275b73dcf91"
|
||||
source_file="res://player/osb_jump.png"
|
||||
dest_files=[ "res://.import/osb_jump.png-0d4d2b2d1a7d2c11e3e4fd800b8589ed.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
34
2d/physics_platformer/player/osb_left.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/osb_left.png-95ec3a371455889d592aa8cae0a755bc.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://player/osb_left.png"
|
||||
dest_files=[ "res://.import/osb_left.png-95ec3a371455889d592aa8cae0a755bc.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
flags/mipmaps=false
|
||||
flags/anisotropic=false
|
||||
flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
svg/scale=1.0
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.stex"
|
||||
path="res://.import/osb_right.png-db9bb4651315f3d42b87bd17a86cce76.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://osb_fire.png"
|
||||
source_md5="99a276197ee76a83312af783f33f0ab3"
|
||||
|
||||
dest_files=[ "res://.import/osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.stex" ]
|
||||
dest_md5="977d51633748d45e85e4c7a214ade70e"
|
||||
source_file="res://player/osb_right.png"
|
||||
dest_files=[ "res://.import/osb_right.png-db9bb4651315f3d42b87bd17a86cce76.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=true
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
@@ -1,56 +1,74 @@
|
||||
extends RigidBody2D
|
||||
|
||||
# Character Demo, written by Juan Linietsky.
|
||||
#
|
||||
# Implementation of a 2D Character controller.
|
||||
# This implementation uses the physics engine for
|
||||
# controlling a character, in a very similar way
|
||||
# than a 3D character controller would be implemented.
|
||||
#
|
||||
# Using the physics engine for this has the main
|
||||
# advantages:
|
||||
# -Easy to write.
|
||||
# -Interaction with other physics-based objects is free
|
||||
# -Only have to deal with the object linear velocity, not position
|
||||
# -All collision/area framework available
|
||||
#
|
||||
# But also has the following disadvantages:
|
||||
#
|
||||
# -Objects may bounce a little bit sometimes
|
||||
# -Going up ramps sends the chracter flying up, small hack is needed.
|
||||
# -A ray collider is needed to avoid sliding down on ramps and
|
||||
# undesiderd bumps, small steps and rare numerical precision errors.
|
||||
# (another alternative may be to turn on friction when the character is not moving).
|
||||
# -Friction cant be used, so floor velocity must be considered
|
||||
# for moving platforms.
|
||||
class_name Player
|
||||
|
||||
""" Character Demo, written by Juan Linietsky.
|
||||
|
||||
Implementation of a 2D Character controller.
|
||||
This implementation uses the physics engine for
|
||||
controlling a character, in a very similar way
|
||||
than a 3D character controller would be implemented.
|
||||
|
||||
Using the physics engine for this has the main advantages:
|
||||
- Easy to write.
|
||||
- Interaction with other physics-based objects is free
|
||||
- Only have to deal with the object linear velocity, not position
|
||||
- All collision/area framework available
|
||||
|
||||
But also has the following disadvantages:
|
||||
- Objects may bounce a little bit sometimes
|
||||
- Going up ramps sends the chracter flying up, small hack is needed.
|
||||
- A ray collider is needed to avoid sliding down on ramps and
|
||||
undesiderd bumps, small steps and rare numerical precision errors.
|
||||
(another alternative may be to turn on friction when the character is not moving).
|
||||
- Friction cant be used, so floor velocity must be considered
|
||||
for moving platforms. """
|
||||
|
||||
# Member variables
|
||||
const WALK_ACCEL = 800.0
|
||||
const WALK_DEACCEL = 800.0
|
||||
const WALK_MAX_VELOCITY = 200.0
|
||||
const AIR_ACCEL = 200.0
|
||||
const AIR_DEACCEL = 200.0
|
||||
const JUMP_VELOCITY = 460
|
||||
const STOP_JUMP_FORCE = 900.0
|
||||
const MAX_SHOOT_POSE_TIME = 0.3
|
||||
const MAX_FLOOR_AIRBORNE_TIME = 0.15
|
||||
|
||||
var anim = ""
|
||||
var siding_left = false
|
||||
var jumping = false
|
||||
var stopping_jump = false
|
||||
var shooting = false
|
||||
|
||||
var WALK_ACCEL = 800.0
|
||||
var WALK_DEACCEL = 800.0
|
||||
var WALK_MAX_VELOCITY = 200.0
|
||||
var AIR_ACCEL = 200.0
|
||||
var AIR_DEACCEL = 200.0
|
||||
var JUMP_VELOCITY = 460
|
||||
var STOP_JUMP_FORCE = 900.0
|
||||
|
||||
var MAX_FLOOR_AIRBORNE_TIME = 0.15
|
||||
var floor_h_velocity = 0.0
|
||||
|
||||
var airborne_time = 1e20
|
||||
var shoot_time = 1e20
|
||||
|
||||
var MAX_SHOOT_POSE_TIME = 0.3
|
||||
var Bullet = preload("res://player/Bullet.tscn")
|
||||
var Enemy = preload("res://enemy/Enemy.tscn")
|
||||
|
||||
var bullet = preload("res://bullet.tscn")
|
||||
|
||||
var floor_h_velocity = 0.0
|
||||
onready var enemy = load("res://enemy.tscn")
|
||||
|
||||
func _shot_bullet():
|
||||
shoot_time = 0
|
||||
var bi = Bullet.instance()
|
||||
var ss
|
||||
if siding_left:
|
||||
ss = -1.0
|
||||
else:
|
||||
ss = 1.0
|
||||
var pos = position + ($BulletShoot as Position2D).position * Vector2(ss, 1.0)
|
||||
|
||||
bi.position = pos
|
||||
get_parent().add_child(bi)
|
||||
|
||||
bi.linear_velocity = Vector2(800.0 * ss, -80)
|
||||
|
||||
($Sprite/Smoke as Particles2D).restart()
|
||||
($SoundShoot as AudioStreamPlayer2D).play()
|
||||
|
||||
add_collision_exception_with(bi) # Make bullet and this not collide
|
||||
|
||||
func _integrate_forces(s):
|
||||
var lv = s.get_linear_velocity()
|
||||
@@ -67,10 +85,12 @@ func _integrate_forces(s):
|
||||
var spawn = Input.is_action_pressed("spawn")
|
||||
|
||||
if spawn:
|
||||
var e = enemy.instance()
|
||||
var e = Enemy.instance()
|
||||
var p = position
|
||||
|
||||
p.y = p.y - 100
|
||||
e.position = p
|
||||
|
||||
get_parent().add_child(e)
|
||||
|
||||
# Deapply prev floor velocity
|
||||
@@ -83,6 +103,7 @@ func _integrate_forces(s):
|
||||
|
||||
for x in range(s.get_contact_count()):
|
||||
var ci = s.get_contact_local_normal(x)
|
||||
|
||||
if ci.dot(Vector2(0, -1)) > 0.6:
|
||||
found_floor = true
|
||||
floor_index = x
|
||||
@@ -90,24 +111,7 @@ func _integrate_forces(s):
|
||||
# A good idea when implementing characters of all kinds,
|
||||
# compensates for physics imprecision, as well as human reaction delay.
|
||||
if shoot and not shooting:
|
||||
shoot_time = 0
|
||||
var bi = bullet.instance()
|
||||
var ss
|
||||
if siding_left:
|
||||
ss = -1.0
|
||||
else:
|
||||
ss = 1.0
|
||||
var pos = position + $bullet_shoot.position * Vector2(ss, 1.0)
|
||||
|
||||
bi.position = pos
|
||||
get_parent().add_child(bi)
|
||||
|
||||
bi.linear_velocity = Vector2(800.0 * ss, -80)
|
||||
|
||||
$sprite/smoke.restart()
|
||||
$sound_shoot.play()
|
||||
|
||||
add_collision_exception_with(bi) # Make bullet and this not collide
|
||||
call_deferred("_shot_bullet")
|
||||
else:
|
||||
shoot_time += step
|
||||
|
||||
@@ -149,7 +153,7 @@ func _integrate_forces(s):
|
||||
lv.y = -JUMP_VELOCITY
|
||||
jumping = true
|
||||
stopping_jump = false
|
||||
$sound_jump.play()
|
||||
($SoundJump as AudioStreamPlayer2D).play()
|
||||
|
||||
# Check siding
|
||||
if lv.x < 0 and move_left:
|
||||
@@ -179,6 +183,7 @@ func _integrate_forces(s):
|
||||
else:
|
||||
var xv = abs(lv.x)
|
||||
xv -= AIR_DEACCEL * step
|
||||
|
||||
if xv < 0:
|
||||
xv = 0
|
||||
lv.x = sign(lv.x) * xv
|
||||
@@ -197,16 +202,16 @@ func _integrate_forces(s):
|
||||
# Update siding
|
||||
if new_siding_left != siding_left:
|
||||
if new_siding_left:
|
||||
$sprite.scale.x = -1
|
||||
($Sprite as Sprite).scale.x = -1
|
||||
else:
|
||||
$sprite.scale.x = 1
|
||||
($Sprite as Sprite).scale.x = 1
|
||||
|
||||
siding_left = new_siding_left
|
||||
|
||||
# Change animation
|
||||
if new_anim != anim:
|
||||
anim = new_anim
|
||||
$anim.play(anim)
|
||||
($Anim as AnimationPlayer).play(anim)
|
||||
|
||||
shooting = shoot
|
||||
|
||||
@@ -217,4 +222,4 @@ func _integrate_forces(s):
|
||||
|
||||
# Finally, apply gravity and set back the linear velocity
|
||||
lv += s.get_total_gravity() * step
|
||||
s.set_linear_velocity(lv)
|
||||
s.set_linear_velocity(lv)
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -2,21 +2,22 @@
|
||||
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/robot_demo.png-8502817e0037b3f31eaca3dae49dcfc5.stex"
|
||||
path="res://.import/robot_demo.png-7165a8ae8f36b01883df6b585a93f592.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://robot_demo.png"
|
||||
source_md5="2a19cb85548217b26700914bd42617b4"
|
||||
|
||||
dest_files=[ "res://.import/robot_demo.png-8502817e0037b3f31eaca3dae49dcfc5.stex" ]
|
||||
dest_md5="a8591e098e3f1315468e7318da46cbb7"
|
||||
source_file="res://player/robot_demo.png"
|
||||
dest_files=[ "res://.import/robot_demo.png-7165a8ae8f36b01883df6b585a93f592.stex" ]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
@@ -6,19 +6,62 @@
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=3
|
||||
config_version=4
|
||||
|
||||
_global_script_classes=[ {
|
||||
"base": "RigidBody2D",
|
||||
"class": "Bullet",
|
||||
"language": "GDScript",
|
||||
"path": "res://player/bullet.gd"
|
||||
}, {
|
||||
"base": "Area2D",
|
||||
"class": "Coin",
|
||||
"language": "GDScript",
|
||||
"path": "res://coin/coin.gd"
|
||||
}, {
|
||||
"base": "RigidBody2D",
|
||||
"class": "Enemy",
|
||||
"language": "GDScript",
|
||||
"path": "res://enemy/enemy.gd"
|
||||
}, {
|
||||
"base": "Node2D",
|
||||
"class": "MovingPlatform",
|
||||
"language": "GDScript",
|
||||
"path": "res://platform/moving_platform.gd"
|
||||
}, {
|
||||
"base": "RigidBody2D",
|
||||
"class": "Player",
|
||||
"language": "GDScript",
|
||||
"path": "res://player/player.gd"
|
||||
} ]
|
||||
_global_script_class_icons={
|
||||
"Bullet": "",
|
||||
"Coin": "",
|
||||
"Enemy": "",
|
||||
"MovingPlatform": "",
|
||||
"Player": ""
|
||||
}
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Dynamic Character Control-Based Platformer"
|
||||
run/main_scene="res://stage.tscn"
|
||||
run/main_scene="res://Stage.tscn"
|
||||
config/icon="res://icon.png"
|
||||
|
||||
[debug]
|
||||
|
||||
gdscript/completion/autocomplete_setters_and_getters=true
|
||||
gdscript/warnings/unsafe_property_access=true
|
||||
gdscript/warnings/unsafe_method_access=true
|
||||
gdscript/warnings/unsafe_cast=true
|
||||
gdscript/warnings/unsafe_call_argument=true
|
||||
|
||||
[display]
|
||||
|
||||
window/size/width=800
|
||||
window/size/height=480
|
||||
window/stretch/mode="2d"
|
||||
window/stretch/aspect="keep"
|
||||
stretch/aspect="keep_height"
|
||||
stretch/mode="2d"
|
||||
|
||||
@@ -32,22 +75,37 @@ repeat=false
|
||||
|
||||
[input]
|
||||
|
||||
jump=[ 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)
|
||||
jump={
|
||||
"deadzone": 0.5,
|
||||
"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)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
move_left=[ 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)
|
||||
}
|
||||
move_left={
|
||||
"deadzone": 0.5,
|
||||
"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)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
move_right=[ 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)
|
||||
}
|
||||
move_right={
|
||||
"deadzone": 0.5,
|
||||
"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)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
shoot=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
|
||||
}
|
||||
shoot={
|
||||
"deadzone": 0.5,
|
||||
"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":32,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
|
||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
|
||||
]
|
||||
spawn=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777244,"unicode":0,"echo":false,"script":null)
|
||||
}
|
||||
spawn={
|
||||
"deadzone": 0.5,
|
||||
"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":16777244,"unicode":0,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[physics]
|
||||
|
||||
@@ -61,6 +119,15 @@ use_pixel_snap=true
|
||||
|
||||
mipmap_policy=1
|
||||
|
||||
[rendering]
|
||||
|
||||
quality/intended_usage/framebuffer_allocation=0
|
||||
quality/intended_usage/framebuffer_allocation.mobile=1
|
||||
quality/filters/anisotropic_filter_level=2
|
||||
quality/filters/use_nearest_mipmap_filter=true
|
||||
quality/voxel_cone_tracing/high_quality=false
|
||||
quality/depth/hdr=false
|
||||
|
||||
[texture_import]
|
||||
|
||||
filter=false
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://plank.png" type="Texture" id=1]
|
||||
[ext_resource path="res://plankpin.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=1]
|
||||
|
||||
custom_solver_bias = 0.0
|
||||
extents = Vector2( 128, 8 )
|
||||
|
||||
[node name="seesaw" type="Node2D"]
|
||||
|
||||
[node name="plank" type="RigidBody2D" parent="."]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
mode = 0
|
||||
mass = 5.10204
|
||||
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
|
||||
linear_velocity = Vector2( 0, 0 )
|
||||
linear_damp = -1.0
|
||||
angular_velocity = 0.0
|
||||
angular_damp = -1.0
|
||||
|
||||
[node name="sprite" type="Sprite" parent="plank"]
|
||||
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="plank"]
|
||||
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="pin" type="PinJoint2D" parent="."]
|
||||
|
||||
node_a = NodePath("../plank")
|
||||
node_b = NodePath("")
|
||||
bias = 0.0
|
||||
disable_collision = true
|
||||
softness = 0.0
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( -0.290825, 20.2425 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_coin.wav-b4defacd1a1eab95585c7b5095506878.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sound_coin.wav"
|
||||
source_md5="c9b8b4e85a53ce0e7add721a872d0479"
|
||||
|
||||
dest_files=[ "res://.import/sound_coin.wav-b4defacd1a1eab95585c7b5095506878.sample" ]
|
||||
dest_md5="e5a76bfdb2a7b57010209e1a78e45030"
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_explode.wav-23e94be75a4346bffb517c7e07035977.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sound_explode.wav"
|
||||
source_md5="c49bffd6268c2fb061a578c559fbd988"
|
||||
|
||||
dest_files=[ "res://.import/sound_explode.wav-23e94be75a4346bffb517c7e07035977.sample" ]
|
||||
dest_md5="51dec829415973af026f4966d5e5d65a"
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sound_hit.wav"
|
||||
source_md5="ce60125d5b1639a3b88d652aea6ca0c3"
|
||||
|
||||
dest_files=[ "res://.import/sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.sample" ]
|
||||
dest_md5="e433fcac326cc1a2c8dc44d629790a7d"
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sound_jump.wav"
|
||||
source_md5="f15f2f75683475fb46217cb108a91d44"
|
||||
|
||||
dest_files=[ "res://.import/sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.sample" ]
|
||||
dest_md5="d93302188764fedd122195b34b711ceb"
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -1,24 +0,0 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sound_shoot.wav"
|
||||
source_md5="5c1909840119124623da414167fad697"
|
||||
|
||||
dest_files=[ "res://.import/sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.sample" ]
|
||||
dest_md5="8c33ecb945ea94e05e6be5ee5a7b0c6b"
|
||||
|
||||
[params]
|
||||
|
||||
force/8_bit=false
|
||||
force/mono=false
|
||||
force/max_rate=false
|
||||
force/max_rate_hz=44100
|
||||
edit/trim=true
|
||||
edit/normalize=true
|
||||
edit/loop=false
|
||||
compress/mode=0
|
||||
@@ -3,20 +3,21 @@
|
||||
importer="texture"
|
||||
type="StreamTexture"
|
||||
path="res://.import/tiles_demo.png-7ca5c7c5c02ab8abe0d585a6a8f086bd.stex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://tiles_demo.png"
|
||||
source_md5="34392fef9536a0df0c258a8cba521bf3"
|
||||
|
||||
dest_files=[ "res://.import/tiles_demo.png-7ca5c7c5c02ab8abe0d585a6a8f086bd.stex" ]
|
||||
dest_md5="50bcf4fa0ff63c13469a9f9bba31f1a4"
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_mode=0
|
||||
compress/bptc_ldr=0
|
||||
compress/normal_map=0
|
||||
flags/repeat=0
|
||||
flags/filter=false
|
||||
@@ -26,6 +27,7 @@ flags/srgb=2
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/HDR_as_SRGB=false
|
||||
process/invert_color=false
|
||||
stream=false
|
||||
size_limit=0
|
||||
detect_3d=true
|
||||
|
||||
@@ -1,308 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://tiles_demo.png" type="Texture" id=1]
|
||||
|
||||
[node name="Node" type="Node"]
|
||||
|
||||
[node name="floor" type="Sprite" parent="."]
|
||||
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 0, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="floor"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="floor/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( 32, -24, 32, 32, -32, 32, -32, -24 )
|
||||
|
||||
[node name="edge" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 64, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 64, 0, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="edge"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="edge/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, -24, 24, -24, 24, 32, -32, 32 )
|
||||
|
||||
[node name="wall" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 64, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 64, 64, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="wall"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="wall/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
|
||||
|
||||
[node name="wall_deco" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 96, 128 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 320, 128, 128, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="wall_deco"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="wall_deco/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -64, -32, -8, -32, -8, 32, -64, 32 )
|
||||
|
||||
[node name="corner" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 64, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 64, 128, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="corner"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="corner/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, -32, 24, -32, 32, -24, 32, 32, -32, 32 )
|
||||
|
||||
[node name="flowers" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 128, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 192, 192, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="flowers"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="flowers/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
|
||||
|
||||
[node name="tree_base" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 192, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 192, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="tree_base"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="tree_base/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
|
||||
|
||||
[node name="tree_mid" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 192, 128 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 128, 64, 64 )
|
||||
|
||||
[node name="tree_mid 2" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 192, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 64, 64, 64 )
|
||||
|
||||
[node name="tree_top" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 192, 0 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 256, 0, 64, 64 )
|
||||
|
||||
[node name="solid" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 0, 64 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 0, 64, 64, 64 )
|
||||
|
||||
[node name="ceiling" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 0, 128 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 384, 64, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="ceiling"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ceiling/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( 32, -32, 32, 32, -32, 32, -32, -32 )
|
||||
|
||||
[node name="ramp" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 256, 224 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 128, 128, 64, 128 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="ramp"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ramp/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, -56, 32, 8, 32, 64, -32, 64 )
|
||||
|
||||
[node name="ceiling2wall" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 0, 192 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 448, 64, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="ceiling2wall"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ceiling2wall/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
|
||||
|
||||
[node name="platform_floor" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 0, 256 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 128, 0, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="platform_floor"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform_floor/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( 32, -24, 32, 24, -32, 24, -32, -24 )
|
||||
|
||||
[node name="platform_edge" type="Sprite" parent="."]
|
||||
|
||||
position = Vector2( 64, 256 )
|
||||
texture = ExtResource( 1 )
|
||||
region_rect = Rect2( 192, 0, 64, 64 )
|
||||
|
||||
[node name="collision" type="StaticBody2D" parent="platform_edge"]
|
||||
|
||||
input_pickable = false
|
||||
collision_layer = 1
|
||||
collision_mask = 1
|
||||
constant_linear_velocity = Vector2( 0, 0 )
|
||||
constant_angular_velocity = 0.0
|
||||
friction = 1.0
|
||||
bounce = 0.0
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform_edge/collision"]
|
||||
|
||||
build_mode = 0
|
||||
polygon = PoolVector2Array( 24, -24, 24, 24, -32, 24, -32, -24 )
|
||||
|
||||
[node name="help" type="Label" parent="."]
|
||||
|
||||
anchor_left = 0.0
|
||||
anchor_top = 0.0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_left = 1.0
|
||||
margin_top = 331.0
|
||||
margin_right = 727.0
|
||||
margin_bottom = 422.0
|
||||
rect_pivot_offset = Vector2( 0, 0 )
|
||||
rect_clip_content = false
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 4
|
||||
text = "This scene serves as a tool for editing the tileset.
|
||||
Nodes (sprites) and their respective collisionsare edited here.
|
||||
|
||||
To create a tileset from this, a \"TileSet\" resoucre must be created. Use the helper in: Scene -> Convert To -> TileSet.
|
||||
This will save a tileset. Saving over it will merge your changes.
|
||||
|
||||
Finally, the saved tileset resource (tileset.tres in this case), can be opened to be used into a TileMap node for editing a tile map."
|
||||
percent_visible = 1.0
|
||||
lines_skipped = 0
|
||||
max_lines_visible = -1
|
||||
|
||||
|
||||