diff --git a/Physics/Crate.png b/Physics/Crate.png new file mode 100644 index 0000000..56312b2 Binary files /dev/null and b/Physics/Crate.png differ diff --git a/Physics/Crate.png.import b/Physics/Crate.png.import new file mode 100644 index 0000000..bb33261 --- /dev/null +++ b/Physics/Crate.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://kekglgglqd17" +path="res://.godot/imported/Crate.png-7a4c9ebe9b79006a7281da23028e26fd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Physics/Crate.png" +dest_files=["res://.godot/imported/Crate.png-7a4c9ebe9b79006a7281da23028e26fd.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 diff --git a/Physics/Physics.tscn b/Physics/Physics.tscn new file mode 100644 index 0000000..27cfd89 --- /dev/null +++ b/Physics/Physics.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=4 format=3 uid="uid://ynpyx1a6qtoq"] + +[ext_resource type="Texture2D" uid="uid://fxeb0j820f47" path="res://Physics/PhysicsCharacter.png" id="1_8qjul"] +[ext_resource type="Script" uid="uid://c5pwbg75g5n8q" path="res://Physics/PhysicsPlayer.gd" id="1_ry666"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_8qjul"] +size = Vector2(18, 18) + +[node name="Main" type="Node2D"] + +[node name="Player" type="RigidBody2D" parent="."] +mass = 5.0 +gravity_scale = 0.0 +linear_damp = 1.0 +script = ExtResource("1_ry666") + +[node name="PhysicsCharacter" type="Sprite2D" parent="Player"] +texture = ExtResource("1_8qjul") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"] +shape = SubResource("RectangleShape2D_8qjul") + +[node name="Camera2D" type="Camera2D" parent="."] +zoom = Vector2(4, 4) diff --git a/Physics/PhysicsCharacter.png b/Physics/PhysicsCharacter.png new file mode 100644 index 0000000..ef5dc02 Binary files /dev/null and b/Physics/PhysicsCharacter.png differ diff --git a/Physics/PhysicsCharacter.png.import b/Physics/PhysicsCharacter.png.import new file mode 100644 index 0000000..c2070d2 --- /dev/null +++ b/Physics/PhysicsCharacter.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://fxeb0j820f47" +path="res://.godot/imported/PhysicsCharacter.png-4dade585e039080dd6220f76fdb8ef04.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Physics/PhysicsCharacter.png" +dest_files=["res://.godot/imported/PhysicsCharacter.png-4dade585e039080dd6220f76fdb8ef04.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 diff --git a/Physics/PhysicsPlayer.gd b/Physics/PhysicsPlayer.gd new file mode 100644 index 0000000..d995e7f --- /dev/null +++ b/Physics/PhysicsPlayer.gd @@ -0,0 +1,8 @@ +extends RigidBody2D + +var hit_force : float = 50.0 + +func _process(delta): + if Input.is_mouse_button_pressed(MOUSE_BUTTON_LEFT): + var dir = global_position.direction_to(get_global_mouse_position()) + apply_impulse(dir * hit_force) diff --git a/Physics/PhysicsPlayer.gd.uid b/Physics/PhysicsPlayer.gd.uid new file mode 100644 index 0000000..03fd347 --- /dev/null +++ b/Physics/PhysicsPlayer.gd.uid @@ -0,0 +1 @@ +uid://c5pwbg75g5n8q diff --git a/Star.png b/Star.png new file mode 100644 index 0000000..a39637b Binary files /dev/null and b/Star.png differ diff --git a/Star.png.import b/Star.png.import new file mode 100644 index 0000000..659c7ce --- /dev/null +++ b/Star.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0smkcrhbdvc1" +path="res://.godot/imported/Star.png-3d67ea69a9a0445133039298d781d14b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Star.png" +dest_files=["res://.godot/imported/Star.png-3d67ea69a9a0445133039298d781d14b.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 diff --git a/project.godot b/project.godot index f6ee2dd..d91a138 100644 --- a/project.godot +++ b/project.godot @@ -18,3 +18,7 @@ config/icon="res://icon.svg" [dotnet] project/assembly_name="GodotMiniProjects" + +[rendering] + +textures/canvas_textures/default_texture_filter=0