Lesson 10
This commit is contained in:
BIN
Physics/Crate.png
Normal file
BIN
Physics/Crate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 184 B |
34
Physics/Crate.png.import
Normal file
34
Physics/Crate.png.import
Normal 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
24
Physics/Physics.tscn
Normal 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)
|
||||
BIN
Physics/PhysicsCharacter.png
Normal file
BIN
Physics/PhysicsCharacter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 199 B |
34
Physics/PhysicsCharacter.png.import
Normal file
34
Physics/PhysicsCharacter.png.import
Normal 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
8
Physics/PhysicsPlayer.gd
Normal 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)
|
||||
1
Physics/PhysicsPlayer.gd.uid
Normal file
1
Physics/PhysicsPlayer.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c5pwbg75g5n8q
|
||||
34
Star.png.import
Normal file
34
Star.png.import
Normal 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
|
||||
@@ -18,3 +18,7 @@ config/icon="res://icon.svg"
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="GodotMiniProjects"
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
|
||||
Reference in New Issue
Block a user