1
0

Lesson 10

This commit is contained in:
FoxSpellCaster
2025-01-10 20:20:30 -05:00
parent 07cf5c6f53
commit 00a1e92556
10 changed files with 139 additions and 0 deletions

BIN
Physics/Crate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 B

34
Physics/Crate.png.import Normal file
View File

@@ -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

24
Physics/Physics.tscn Normal file
View File

@@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

View File

@@ -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

8
Physics/PhysicsPlayer.gd Normal file
View File

@@ -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)

View File

@@ -0,0 +1 @@
uid://c5pwbg75g5n8q

BIN
Star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

34
Star.png.import Normal file
View File

@@ -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

View File

@@ -18,3 +18,7 @@ config/icon="res://icon.svg"
[dotnet]
project/assembly_name="GodotMiniProjects"
[rendering]
textures/canvas_textures/default_texture_filter=0