coins, parralaxbg, terrain,physics layer
BIN
assets/graphics/environment/backgrounds/block.png
Normal file
After Width: | Height: | Size: 934 B |
34
assets/graphics/environment/backgrounds/block.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bltcodwg82who"
|
||||
path="res://.godot/imported/block.png-3aa040c2e63d44fce35c994ecca4a9d9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/environment/backgrounds/block.png"
|
||||
dest_files=["res://.godot/imported/block.png-3aa040c2e63d44fce35c994ecca4a9d9.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/environment/backgrounds/forestbackground.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b1pfjj3fy2omh"
|
||||
path="res://.godot/imported/forestbackground.png-1170ae197e211023a79091cf48300332.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/environment/backgrounds/forestbackground.png"
|
||||
dest_files=["res://.godot/imported/forestbackground.png-1170ae197e211023a79091cf48300332.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/environment/backgrounds/sky.png
Normal file
After Width: | Height: | Size: 692 B |
34
assets/graphics/environment/backgrounds/sky.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bcbxw0bqcx1ra"
|
||||
path="res://.godot/imported/sky.png-b132b9e240387925c40cca10d1d14c56.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/environment/backgrounds/sky.png"
|
||||
dest_files=["res://.godot/imported/sky.png-b132b9e240387925c40cca10d1d14c56.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/environment/backgrounds/trees.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
34
assets/graphics/environment/backgrounds/trees.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dhbq35sm7q38"
|
||||
path="res://.godot/imported/trees.png-b1cfb32a6f99a640507fdab863a473f5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/environment/backgrounds/trees.png"
|
||||
dest_files=["res://.godot/imported/trees.png-b1cfb32a6f99a640507fdab863a473f5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/environment/terrain/mushroom_32x64.png
Normal file
After Width: | Height: | Size: 2.7 KiB |
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bk35d1yyqwvxf"
|
||||
path="res://.godot/imported/mushroom_32x64.png-cefb137d64a82ca31a8f0068d916c09f.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/environment/terrain/mushroom_32x64.png"
|
||||
dest_files=["res://.godot/imported/mushroom_32x64.png-cefb137d64a82ca31a8f0068d916c09f.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/environment/terrain/veg_32x32.png
Normal file
After Width: | Height: | Size: 675 B |
34
assets/graphics/environment/terrain/veg_32x32.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ctremhbhix1fj"
|
||||
path="res://.godot/imported/veg_32x32.png-4b0b47ef99f3aa28e8f24956e44a31a5.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/environment/terrain/veg_32x32.png"
|
||||
dest_files=["res://.godot/imported/veg_32x32.png-4b0b47ef99f3aa28e8f24956e44a31a5.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/objects/crate.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
34
assets/graphics/objects/crate.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bvm82m176wflv"
|
||||
path="res://.godot/imported/crate.png-b286bd97caa3cbc59746f2db7de46191.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/objects/crate.png"
|
||||
dest_files=["res://.godot/imported/crate.png-b286bd97caa3cbc59746f2db7de46191.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/pickups/coin.png
Normal file
After Width: | Height: | Size: 500 B |
34
assets/graphics/pickups/coin.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dqt56yigjia14"
|
||||
path="res://.godot/imported/coin.png-f0b33289d8d72c34d5a0c76da4c0f19c.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/pickups/coin.png"
|
||||
dest_files=["res://.godot/imported/coin.png-f0b33289d8d72c34d5a0c76da4c0f19c.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/projectiles/coin.png
Normal file
After Width: | Height: | Size: 500 B |
34
assets/graphics/projectiles/coin.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cqfcr400bxn17"
|
||||
path="res://.godot/imported/coin.png-4c7dc7453870774524b4849f32b6deac.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/projectiles/coin.png"
|
||||
dest_files=["res://.godot/imported/coin.png-4c7dc7453870774524b4849f32b6deac.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
BIN
assets/graphics/projectiles/pixel_bullet.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
34
assets/graphics/projectiles/pixel_bullet.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c4jgxarp4pf2s"
|
||||
path="res://.godot/imported/pixel_bullet.png-30d6d1e8b5e1332f8b2e2cee72a9e790.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/graphics/projectiles/pixel_bullet.png"
|
||||
dest_files=["res://.godot/imported/pixel_bullet.png-30d6d1e8b5e1332f8b2e2cee72a9e790.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
@ -12,9 +12,17 @@ config_version=5
|
||||
|
||||
config/name="JulyGame"
|
||||
run/main_scene="res://scenes/game.tscn"
|
||||
config/features=PackedStringArray("4.4", "Forward Plus")
|
||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=320
|
||||
window/size/viewport_height=180
|
||||
window/size/window_width_override=960
|
||||
window/size/window_height_override=540
|
||||
window/stretch/mode="viewport"
|
||||
|
||||
[input]
|
||||
|
||||
shove={
|
||||
|
@ -1,15 +1,24 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://lg8k51aicde4"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://lg8k51aicde4"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://p7brl4n4miw6" path="res://scripts/bullet.gd" id="1_bpcfw"]
|
||||
[ext_resource type="Script" path="res://scripts/bullet.gd" id="1_bpcfw"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4jgxarp4pf2s" path="res://assets/graphics/projectiles/pixel_bullet.png" id="2_imvee"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_oprgb"]
|
||||
size = Vector2(8, 4)
|
||||
size = Vector2(8, 3)
|
||||
|
||||
[node name="Bullet" type="Area2D"]
|
||||
script = ExtResource("1_bpcfw")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -0.5)
|
||||
shape = SubResource("RectangleShape2D_oprgb")
|
||||
debug_color = Color(0.866207, 0.326527, 0.373638, 0.42)
|
||||
|
||||
[node name="BulletGraphic" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(-2, -2)
|
||||
rotation = 3.14159
|
||||
scale = Vector2(0.0601394, 0.0601394)
|
||||
texture = ExtResource("2_imvee")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
|
114
scenes/coin.tscn
Normal file
@ -0,0 +1,114 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://bxgmkcya2nup8"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_0370w"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqt56yigjia14" path="res://assets/graphics/pickups/coin.png" id="1_w8jar"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xqi52"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_timbf"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(16, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a81kj"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5ia0i"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(48, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mxyi7"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(64, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ou15j"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(80, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_psh60"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(96, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_0dxws"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(112, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8nfrw"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(128, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_mkdvk"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(144, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_04na0"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(160, 0, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_bcvj3"]
|
||||
atlas = ExtResource("1_w8jar")
|
||||
region = Rect2(176, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_p0bax"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_xqi52")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_timbf")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_a81kj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_5ia0i")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mxyi7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_ou15j")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_psh60")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_0dxws")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_8nfrw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_mkdvk")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_04na0")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_bcvj3")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_1unyf"]
|
||||
|
||||
[node name="Coin" type="Area2D"]
|
||||
script = ExtResource("1_0370w")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
sprite_frames = SubResource("SpriteFrames_p0bax")
|
||||
animation = &"idle"
|
||||
autoplay = "idle"
|
||||
frame_progress = 0.293314
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
scale = Vector2(0.597135, 0.597135)
|
||||
shape = SubResource("CircleShape2D_1unyf")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
@ -1,14 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://d0mw3eh00s3kr"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d0mw3eh00s3kr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bv1u5eyjco2m8" path="res://scripts/crate.gd" id="1_j2btj"]
|
||||
[ext_resource type="Script" path="res://scripts/crate.gd" id="1_j2btj"]
|
||||
[ext_resource type="Texture2D" uid="uid://bvm82m176wflv" path="res://assets/graphics/objects/crate.png" id="2_x3laa"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"]
|
||||
size = Vector2(22, 23)
|
||||
|
||||
[node name="Crate" type="RigidBody2D" groups=["pushables", "shootables"]]
|
||||
rotation = 0.602841
|
||||
script = ExtResource("1_j2btj")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." groups=["shootables"]]
|
||||
position = Vector2(0, -1.5)
|
||||
shape = SubResource("RectangleShape2D_uwrxv")
|
||||
debug_color = Color(0.820447, 0.391315, 0.259417, 0.42)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.08, 0.08)
|
||||
texture = ExtResource("2_x3laa")
|
||||
|
435
scenes/game.tscn
@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=28 format=3 uid="uid://b5p1mlv4c1olv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cnwga6l2btdbk" path="res://scripts/player.gd" id="1_bqfhv"]
|
||||
[ext_resource type="Script" path="res://scripts/player.gd" id="1_bqfhv"]
|
||||
[ext_resource type="Texture2D" uid="uid://daf4mmxa2xsjv" path="res://assets/graphics/player/jump_fall/player jump 48x48(1).png" id="2_dqkch"]
|
||||
[ext_resource type="Texture2D" uid="uid://djtlpe43a18d5" path="res://assets/graphics/player/idle/Player Idle 48x48.png" id="2_g2els"]
|
||||
[ext_resource type="Texture2D" uid="uid://dctuuekg8fi6i" path="res://assets/graphics/player/run/player run 48x48.png" id="3_qhqgy"]
|
||||
@ -208,4 +208,7 @@ sprite_frames = SubResource("SpriteFrames_jej6c")
|
||||
animation = &"jump"
|
||||
autoplay = "idle"
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
offset = Vector2(0, -40)
|
||||
|
||||
[connection signal="animation_finished" from="PlayerGraphic" to="." method="_on_animation_finished"]
|
||||
|
@ -1,4 +1,5 @@
|
||||
class_name Bullet extends Area2D
|
||||
@onready var bullet_graphic: Sprite2D = $BulletGraphic
|
||||
|
||||
|
||||
var speed:float = 700
|
||||
@ -6,6 +7,10 @@ signal bulletDamageSignal(body,bullet)
|
||||
|
||||
func setSpeed(value:float):
|
||||
speed = value
|
||||
if value<0:
|
||||
bullet_graphic.flip_h = true
|
||||
if value>0:
|
||||
bullet_graphic.flip_h = false
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position += transform.x * speed * delta
|
||||
@ -16,3 +21,4 @@ func _on_body_entered(body: Node2D) -> void:
|
||||
if body.is_in_group("shootables"):
|
||||
|
||||
bulletDamageSignal.emit(body,self)
|
||||
|
||||
|
8
scripts/coin.gd
Normal file
@ -0,0 +1,8 @@
|
||||
class_name Coin extends Area2D
|
||||
|
||||
signal coinCollectedSignal(body, coin)
|
||||
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
print("coin collision")
|
||||
coinCollectedSignal.emit(body, self)
|
@ -25,3 +25,6 @@ func bulletDamage(body, bullet):
|
||||
print("gc knows about bullet hit")
|
||||
body.queue_free()
|
||||
#apply_central_impulse(Vector2(shoveDirection,0)*700)
|
||||
|
||||
func coinCollected(body,coin):
|
||||
print("gc knows coin collected")
|
||||
|
@ -10,7 +10,7 @@ class_name Player extends CharacterBody2D
|
||||
const SPEED = 300
|
||||
const JUMP_VELOCITY = -400.0
|
||||
|
||||
@export var acceleration:int = 5
|
||||
@export var acceleration:int = 15
|
||||
var upJump:bool = false
|
||||
|
||||
var direction
|
||||
|
@ -4,6 +4,8 @@ var totalAllowedBullets = 7
|
||||
var bullet = preload("res://scenes/bullet.tscn")
|
||||
@onready var game: Node2D = $".."
|
||||
@onready var triggers: Node2D = $"../triggers"
|
||||
@onready var coins: Node2D = $"../coins"
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
@ -13,6 +15,13 @@ func _ready() -> void:
|
||||
obj.areaTriggerSignal.connect(game._on_trigger)
|
||||
|
||||
|
||||
if coins:
|
||||
print("found coins")
|
||||
for obj in coins.get_children():
|
||||
if obj is Coin:
|
||||
print("coin collected")
|
||||
obj.coinCollectedSignal.connect(game.coinCollected)
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|