Compare commits
11 Commits
2399a5405e
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f8ea70f64 | |||
| 86c34c9264 | |||
| d881d14010 | |||
| 2bdba756b8 | |||
| 85975a64ad | |||
| 5262463741 | |||
| af6dd97cb3 | |||
| 06574ac10e | |||
| 4e032718e8 | |||
| 3485bc4f9f | |||
| e6a480ee37 |
15
3d_test.gd
Normal file
15
3d_test.gd
Normal file
@@ -0,0 +1,15 @@
|
||||
extends Node3D
|
||||
|
||||
var DebugScene = preload("res://DebugUI.tscn").instantiate()
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
get_tree().root.add_child(DebugScene)
|
||||
|
||||
func _input(event):
|
||||
if event.is_action_pressed("ui_menu"):
|
||||
pass
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
$CameraCenter.position = $Player.position
|
||||
38
3d_test.tscn
Normal file
38
3d_test.tscn
Normal file
@@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://b6qd2ja2kaul8"]
|
||||
|
||||
[ext_resource type="Script" path="res://3d_test.gd" id="1_o7asi"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctgbbvgfnocql" path="res://player3d.tscn" id="1_osef0"]
|
||||
[ext_resource type="PackedScene" uid="uid://fjxeinktml2j" path="res://map_3d_test.tscn" id="2_3miw1"]
|
||||
[ext_resource type="Script" path="res://map_3d_test.gd" id="3_15ip2"]
|
||||
[ext_resource type="PackedScene" uid="uid://cb4hfwfbpcqy4" path="res://box_obstacle.tscn" id="3_qc72a"]
|
||||
|
||||
[node name="Node3D" type="Node3D"]
|
||||
script = ExtResource("1_o7asi")
|
||||
|
||||
[node name="Sun" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 9.82951, 0)
|
||||
shadow_enabled = true
|
||||
directional_shadow_pancake_size = 0.0
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_osef0")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.58914, -2.38419e-07)
|
||||
|
||||
[node name="TestTerrain" parent="." instance=ExtResource("2_3miw1")]
|
||||
script = ExtResource("3_15ip2")
|
||||
|
||||
[node name="Box" parent="." instance=ExtResource("3_qc72a")]
|
||||
transform = Transform3D(1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, 20.5883, 0.829506, -4.05434)
|
||||
|
||||
[node name="Box2" parent="." instance=ExtResource("3_qc72a")]
|
||||
transform = Transform3D(1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, 7.65501, 0.829506, 7.05613)
|
||||
|
||||
[node name="Box3" parent="." instance=ExtResource("3_qc72a")]
|
||||
transform = Transform3D(1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, 0, 0.829506, -6)
|
||||
|
||||
[node name="Box4" parent="." instance=ExtResource("3_qc72a")]
|
||||
transform = Transform3D(1, 0, 0, 0, -1, -8.74228e-08, 0, 8.74228e-08, -1, -10.006, 0.829506, -6)
|
||||
|
||||
[node name="CameraCenter" type="Node3D" parent="."]
|
||||
|
||||
[node name="CameraView" type="Camera3D" parent="CameraCenter"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.979855, 0.19971, 0, -0.19971, 0.979855, 0, 2.02649, 2.24099)
|
||||
11
3dobstacle.gd
Normal file
11
3dobstacle.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends Node
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
15
DebugUI.tscn
Normal file
15
DebugUI.tscn
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_scene format=3 uid="uid://bnsajfwanp0gv"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 592.0
|
||||
offset_bottom = 290.0
|
||||
color = Color(0.516236, 0.215923, 1, 1)
|
||||
BIN
art/TileMap.aseprite
Normal file
BIN
art/TileMap.aseprite
Normal file
Binary file not shown.
BIN
art/TileMap.png
Normal file
BIN
art/TileMap.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
35
art/TileMap.png.import
Normal file
35
art/TileMap.png.import
Normal file
@@ -0,0 +1,35 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bbmlq6lulxkdc"
|
||||
path.s3tc="res://.godot/imported/TileMap.png-b7cc102f901c5c8b07c5f5b72d97252e.s3tc.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/TileMap.png"
|
||||
dest_files=["res://.godot/imported/TileMap.png-b7cc102f901c5c8b07c5f5b72d97252e.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
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=0
|
||||
BIN
art/player/armless/Head.aseprite
Normal file
BIN
art/player/armless/Head.aseprite
Normal file
Binary file not shown.
BIN
art/player/armless/Head.png
Normal file
BIN
art/player/armless/Head.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 166 B |
34
art/player/armless/Head.png.import
Normal file
34
art/player/armless/Head.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ckjiab5dn7w2g"
|
||||
path="res://.godot/imported/Head.png-018a248f035c73ebc6324211b7bf19c6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/player/armless/Head.png"
|
||||
dest_files=["res://.godot/imported/Head.png-018a248f035c73ebc6324211b7bf19c6.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
art/player/armless/PlayerArmless.aseprite
Normal file
BIN
art/player/armless/PlayerArmless.aseprite
Normal file
Binary file not shown.
BIN
art/player/armless/PlayerArmless.png
Normal file
BIN
art/player/armless/PlayerArmless.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 B |
34
art/player/armless/PlayerArmless.png.import
Normal file
34
art/player/armless/PlayerArmless.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b5jsyliv8lppk"
|
||||
path="res://.godot/imported/PlayerArmless.png-155875c28fbcca594a6ac1aafaba1fcc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/player/armless/PlayerArmless.png"
|
||||
dest_files=["res://.godot/imported/PlayerArmless.png-155875c28fbcca594a6ac1aafaba1fcc.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
art/player/armless/Torso.aseprite
Normal file
BIN
art/player/armless/Torso.aseprite
Normal file
Binary file not shown.
BIN
art/player/armless/Torso.png
Normal file
BIN
art/player/armless/Torso.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 91 B |
34
art/player/armless/Torso.png.import
Normal file
34
art/player/armless/Torso.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cusfqgig0663f"
|
||||
path="res://.godot/imported/Torso.png-9602c264faab83c71bab9a1d5e862d6d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/player/armless/Torso.png"
|
||||
dest_files=["res://.godot/imported/Torso.png-9602c264faab83c71bab9a1d5e862d6d.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
art/player/armless/arm.png
Normal file
BIN
art/player/armless/arm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 118 B |
34
art/player/armless/arm.png.import
Normal file
34
art/player/armless/arm.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ccuscvhy2sr7q"
|
||||
path="res://.godot/imported/arm.png-5502921e18475ef8df73868d13ef4f5d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/player/armless/arm.png"
|
||||
dest_files=["res://.godot/imported/arm.png-5502921e18475ef8df73868d13ef4f5d.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
art/player/armless/botarm.aseprite
Normal file
BIN
art/player/armless/botarm.aseprite
Normal file
Binary file not shown.
BIN
art/player/armless/leg.aseprite
Normal file
BIN
art/player/armless/leg.aseprite
Normal file
Binary file not shown.
BIN
art/player/armless/leg.png
Normal file
BIN
art/player/armless/leg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 B |
34
art/player/armless/leg.png.import
Normal file
34
art/player/armless/leg.png.import
Normal file
@@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://tkojfqb5uwa0"
|
||||
path="res://.godot/imported/leg.png-016a0281814788befc7f135e5e899083.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://art/player/armless/leg.png"
|
||||
dest_files=["res://.godot/imported/leg.png-016a0281814788befc7f135e5e899083.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
art/player/armless/toparm.aseprite
Normal file
BIN
art/player/armless/toparm.aseprite
Normal file
Binary file not shown.
15
box_obstacle.tscn
Normal file
15
box_obstacle.tscn
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cb4hfwfbpcqy4"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_mpwqk"]
|
||||
size = Vector3(1, 2, 1)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_ocyf5"]
|
||||
size = Vector3(1, 2, 1)
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D"]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_mpwqk")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_ocyf5")
|
||||
20
disc.tscn
Normal file
20
disc.tscn
Normal file
@@ -0,0 +1,20 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bm6vv074tk0nx"]
|
||||
|
||||
[sub_resource type="CylinderMesh" id="CylinderMesh_f68ox"]
|
||||
top_radius = 0.25
|
||||
bottom_radius = 0.25
|
||||
height = 0.05
|
||||
|
||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_6l5gm"]
|
||||
height = 0.05
|
||||
radius = 0.25
|
||||
|
||||
[node name="Disc" type="RigidBody3D"]
|
||||
collision_layer = 4
|
||||
collision_mask = 5
|
||||
|
||||
[node name="Model" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("CylinderMesh_f68ox")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("CylinderShape3D_6l5gm")
|
||||
27
game_arena.gd
Normal file
27
game_arena.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends Node2D
|
||||
|
||||
var camera_follows :Node2D= null
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
camera_follows = $Player
|
||||
# Limit Camera bounds to the TileMap
|
||||
var map_rect :Rect2i= $TileMap.get_used_rect()
|
||||
var map_tile_size = $TileMap.tile_set.tile_size
|
||||
var map_scale_x :float= $TileMap.scale.x * map_tile_size.x
|
||||
var map_scale_y :float= $TileMap.scale.y * map_tile_size.y
|
||||
var left_top = map_rect.position
|
||||
var right_bottom = map_rect.end
|
||||
$Camera2D.limit_left = left_top[0] * map_scale_x
|
||||
$Camera2D.limit_top = left_top[1] * map_scale_y
|
||||
$Camera2D.limit_right = right_bottom[0] * map_scale_x
|
||||
$Camera2D.limit_bottom = right_bottom[1] * map_scale_y
|
||||
|
||||
func camera_follow():
|
||||
if camera_follows == null:
|
||||
return
|
||||
$Camera2D.position = camera_follows.position
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
camera_follow()
|
||||
155
game_arena.tscn
155
game_arena.tscn
File diff suppressed because one or more lines are too long
11
map_3d_test.gd
Normal file
11
map_3d_test.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends StaticBody3D
|
||||
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
17
map_3d_test.tscn
Normal file
17
map_3d_test.tscn
Normal file
@@ -0,0 +1,17 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://fjxeinktml2j"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_763vg"]
|
||||
size = Vector2(100, 100)
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2fd53"]
|
||||
|
||||
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_xh6w0"]
|
||||
|
||||
[node name="Terrain" type="StaticBody3D"]
|
||||
|
||||
[node name="Plane" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("PlaneMesh_763vg")
|
||||
surface_material_override/0 = SubResource("StandardMaterial3D_2fd53")
|
||||
|
||||
[node name="WorldPlane" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("WorldBoundaryShape3D_xh6w0")
|
||||
31
player.gd
31
player.gd
@@ -6,26 +6,22 @@ var heldFrisbee :CharacterBody2D= null
|
||||
|
||||
var remote_player :bool= false
|
||||
|
||||
var max_walk :float= 10
|
||||
var accel_walk :float= 100
|
||||
|
||||
var max_run :float= 20
|
||||
var accel_run :float= 2 * accel_walk
|
||||
|
||||
var friction_tonic :float= 1e-1
|
||||
|
||||
var move_dir :Vector2= Vector2.ZERO
|
||||
var move_force :float= 500
|
||||
var max_speed :float= 500
|
||||
var move_friction :float= 1000
|
||||
var tonic_friction :float= 100
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
$PlayerSprite.play("still")
|
||||
pass
|
||||
|
||||
func set_move_direction(dir):
|
||||
move_dir = dir
|
||||
|
||||
func move_player(delta):
|
||||
position.x += move_dir.x * max_walk
|
||||
position.y += move_dir.y * max_walk
|
||||
velocity = max_speed * move_dir
|
||||
move_and_slide()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
@@ -50,12 +46,9 @@ func _input(event):
|
||||
"flick_down"
|
||||
)
|
||||
|
||||
var flick_rot :float= 0
|
||||
if flick.length_squared() != 0:
|
||||
if heldFrisbee == null:
|
||||
heldFrisbee = frisbee.instantiate()
|
||||
$PlayerSprite/FrisbeeLocation.add_child(heldFrisbee)
|
||||
$PlayerSprite.play("throw")
|
||||
else:
|
||||
$PlayerSprite.play("still")
|
||||
$PlayerSprite/FrisbeeLocation.remove_child(heldFrisbee)
|
||||
heldFrisbee = null
|
||||
flick_rot = flick.angle() - PI/8*3
|
||||
|
||||
$LeftArm.rotation = flick_rot
|
||||
$RightArm.rotation = flick_rot
|
||||
|
||||
108
player.tscn
108
player.tscn
@@ -1,63 +1,71 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://btlutggxxokno"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://btlutggxxokno"]
|
||||
|
||||
[ext_resource type="Script" path="res://player.gd" id="1_8jh48"]
|
||||
[ext_resource type="Texture2D" uid="uid://yfxicvvu3j1k" path="res://art/player/Player1.png" id="1_wikqw"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctik1n8vyproe" path="res://art/player/Player2.png" id="2_31x2h"]
|
||||
[ext_resource type="Texture2D" uid="uid://c5jkrxnrk8s4y" path="res://art/player/Player3.png" id="3_xoeqj"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxg6vu3byvcfa" path="res://art/player/Player4.png" id="4_08rsg"]
|
||||
[ext_resource type="Texture2D" uid="uid://dfia7yrc5ds2w" path="res://art/player/throw/PlayerThrow1.png" id="6_yjoir"]
|
||||
[ext_resource type="Texture2D" uid="uid://isrtm6ip2y5a" path="res://art/player/throw/PlayerThrow2.png" id="7_qb6xx"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_obpd0"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_wikqw")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_31x2h")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_xoeqj")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("4_08rsg")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"still",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("6_yjoir")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("7_qb6xx")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"throw",
|
||||
"speed": 5.0
|
||||
}]
|
||||
[ext_resource type="Texture2D" uid="uid://ccuscvhy2sr7q" path="res://art/player/armless/arm.png" id="2_xl6gi"]
|
||||
[ext_resource type="Texture2D" uid="uid://tkojfqb5uwa0" path="res://art/player/armless/leg.png" id="3_f4wmq"]
|
||||
[ext_resource type="Texture2D" uid="uid://cusfqgig0663f" path="res://art/player/armless/Torso.png" id="4_qwft1"]
|
||||
[ext_resource type="Texture2D" uid="uid://ckjiab5dn7w2g" path="res://art/player/armless/Head.png" id="5_txf20"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_m60wa"]
|
||||
size = Vector2(27.5, 48)
|
||||
size = Vector2(22, 50)
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
motion_mode = 1
|
||||
script = ExtResource("1_8jh48")
|
||||
|
||||
[node name="PlayerSprite" type="AnimatedSprite2D" parent="."]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -25)
|
||||
shape = SubResource("RectangleShape2D_m60wa")
|
||||
|
||||
[node name="RightArm" type="Node2D" parent="."]
|
||||
position = Vector2(6, -31)
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="RightArmSprite" type="Sprite2D" parent="RightArm"]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, 5)
|
||||
texture = ExtResource("2_xl6gi")
|
||||
|
||||
[node name="RightLeg" type="Node2D" parent="."]
|
||||
position = Vector2(3, -16)
|
||||
|
||||
[node name="RightLegSprite" type="Sprite2D" parent="RightLeg"]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, 8)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("3_f4wmq")
|
||||
|
||||
[node name="Torso" type="Sprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -24)
|
||||
scale = Vector2(2, 2)
|
||||
sprite_frames = SubResource("SpriteFrames_obpd0")
|
||||
animation = &"throw"
|
||||
frame = 1
|
||||
frame_progress = 0.593015
|
||||
texture = ExtResource("4_qwft1")
|
||||
|
||||
[node name="FrisbeeLocation" type="Node2D" parent="PlayerSprite"]
|
||||
position = Vector2(-0.5, 2.5)
|
||||
[node name="LeftLeg" type="Node2D" parent="."]
|
||||
position = Vector2(3, -16)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
z_index = -1
|
||||
position = Vector2(0.25, -24)
|
||||
shape = SubResource("RectangleShape2D_m60wa")
|
||||
[node name="LeftLegSprite" type="Sprite2D" parent="LeftLeg"]
|
||||
texture_filter = 1
|
||||
position = Vector2(-6, 8)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("3_f4wmq")
|
||||
|
||||
[node name="Head" type="Node2D" parent="."]
|
||||
position = Vector2(0, -32)
|
||||
|
||||
[node name="HeadSprite" type="Sprite2D" parent="Head"]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -9)
|
||||
scale = Vector2(2, 2)
|
||||
texture = ExtResource("5_txf20")
|
||||
|
||||
[node name="LeftArm" type="Node2D" parent="."]
|
||||
position = Vector2(-6, -31)
|
||||
scale = Vector2(2, 2)
|
||||
|
||||
[node name="LeftArmSprite" type="Sprite2D" parent="LeftArm"]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, 5)
|
||||
texture = ExtResource("2_xl6gi")
|
||||
|
||||
81
player3d.gd
Normal file
81
player3d.gd
Normal file
@@ -0,0 +1,81 @@
|
||||
extends CharacterBody3D
|
||||
|
||||
var remote_player = false
|
||||
|
||||
const SPEED = 5.0
|
||||
const JUMP_VELOCITY = 4.5
|
||||
|
||||
const Disc = preload("res://disc.tscn")
|
||||
var heldItem = null
|
||||
|
||||
# Get the gravity from the project settings to be synced with RigidBody nodes.
|
||||
var gravity = ProjectSettings.get_setting("physics/3d/default_gravity")
|
||||
|
||||
# TODO: Add Tween for rotation, maybe
|
||||
func enterThrowMode():
|
||||
$Torso.rotation_degrees.y = 110
|
||||
|
||||
# TODO: Add Tweens between modes
|
||||
func leaveThroeMode():
|
||||
rotation.y = 0
|
||||
|
||||
func _input(event):
|
||||
if Input.is_action_pressed("player_taunt"):
|
||||
enterThrowMode()
|
||||
if heldItem == null:
|
||||
heldItem = Disc.instantiate()
|
||||
heldItem.freeze_mode = RigidBody3D.FREEZE_MODE_STATIC
|
||||
heldItem.freeze = true
|
||||
$Torso/RightArm/Hand.add_child(heldItem)
|
||||
|
||||
func _physics_process(delta):
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
|
||||
# Handle Jump.
|
||||
if Input.is_action_just_pressed("player_jump") and is_on_floor():
|
||||
velocity.y = JUMP_VELOCITY
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
var input_dir = Input.get_vector("player_left", "player_right", "player_up", "player_down")
|
||||
|
||||
var direction = (transform.basis * Vector3(input_dir.x, 0, input_dir.y))
|
||||
if direction:
|
||||
velocity.x = direction.x * SPEED
|
||||
velocity.z = direction.z * SPEED
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0, SPEED)
|
||||
velocity.z = move_toward(velocity.z, 0, SPEED)
|
||||
|
||||
var flick = Input.get_vector(
|
||||
"flick_left",
|
||||
"flick_right",
|
||||
"flick_up",
|
||||
"flick_down"
|
||||
)
|
||||
|
||||
var flick_ang :float= 0
|
||||
if flick.length_squared() != 0:
|
||||
flick_ang = flick.angle()
|
||||
|
||||
if heldItem == null:
|
||||
var flick_rot = Vector3(0,0,flick_ang)
|
||||
$Torso/LeftArm.rotation = flick_rot
|
||||
$Torso/RightArm.rotation = -flick_rot
|
||||
else:
|
||||
var flick_rot = Vector3(0,flick_ang - PI/4,0)
|
||||
$Torso/LeftArm.rotation_degrees.z = 70
|
||||
$Torso/RightArm.rotation.y = clamp(flick_ang,0,PI/2)
|
||||
|
||||
var speed = velocity.length()
|
||||
|
||||
if speed > 0:
|
||||
$Running.speed_scale = speed/SPEED*3
|
||||
$Running.play("player_run")
|
||||
else:
|
||||
var stop_tween :Tween= $Running.create_tween()
|
||||
$Running.stop(true)
|
||||
stop_tween.tween_property(self, "rotation", Vector3(0,0,0), 0.2)
|
||||
|
||||
move_and_slide()
|
||||
101
player3d.tscn
Normal file
101
player3d.tscn
Normal file
@@ -0,0 +1,101 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://ctgbbvgfnocql"]
|
||||
|
||||
[ext_resource type="Script" path="res://player3d.gd" id="1_8eds3"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_vyj2w"]
|
||||
size = Vector3(1, 2, 1)
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_8g2hv"]
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_1k7yw"]
|
||||
radius = 0.175
|
||||
height = 1.25
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_1okp8"]
|
||||
radius = 0.25
|
||||
|
||||
[sub_resource type="Animation" id="Animation_s653s"]
|
||||
resource_name = "player_run"
|
||||
length = 2.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:rotation")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.5, 1, 1.5, 2),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0), Vector3(0, 0, -0.261799), Vector3(0, 0, -2.98023e-08), Vector3(0, 0, 0.261799), Vector3(0, 0, -1.49012e-08)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_wbwlv"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath(".:rotation")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(0, 0, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_aq07q"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_wbwlv"),
|
||||
"player_run": SubResource("Animation_s653s")
|
||||
}
|
||||
|
||||
[node name="Player" type="CharacterBody3D"]
|
||||
script = ExtResource("1_8eds3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("BoxShape3D_vyj2w")
|
||||
|
||||
[node name="Torso" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_8g2hv")
|
||||
|
||||
[node name="LeftArm" type="Node3D" parent="Torso"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 0.2, 0)
|
||||
|
||||
[node name="Arm" type="MeshInstance3D" parent="Torso/LeftArm"]
|
||||
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, -0.4, 0, 0)
|
||||
mesh = SubResource("CapsuleMesh_1k7yw")
|
||||
skeleton = NodePath("../../..")
|
||||
|
||||
[node name="LeftHand" type="StaticBody3D" parent="Torso/LeftArm"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 0)
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="LeftHand" type="CollisionShape3D" parent="Torso/LeftArm/LeftHand"]
|
||||
shape = SubResource("SphereShape3D_1okp8")
|
||||
|
||||
[node name="RightArm" type="Node3D" parent="Torso"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.2, 0)
|
||||
|
||||
[node name="Arm" type="MeshInstance3D" parent="Torso/RightArm"]
|
||||
transform = Transform3D(-4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0, 0, 1, 0.4, 0, 0)
|
||||
mesh = SubResource("CapsuleMesh_1k7yw")
|
||||
skeleton = NodePath("../../..")
|
||||
|
||||
[node name="Hand" type="StaticBody3D" parent="Torso/RightArm"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0)
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="Hand" type="CollisionShape3D" parent="Torso/RightArm/Hand"]
|
||||
shape = SubResource("SphereShape3D_1okp8")
|
||||
|
||||
[node name="Running" type="AnimationPlayer" parent="."]
|
||||
speed_scale = 2.0
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_aq07q")
|
||||
}
|
||||
@@ -13,10 +13,13 @@ config_version=5
|
||||
config/name="FrisbeeFriendsy"
|
||||
run/main_scene="res://title_screen.tscn"
|
||||
config/features=PackedStringArray("4.0", "Mobile")
|
||||
boot_splash/bg_color=Color(0, 0, 0, 1)
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=1920
|
||||
window/size/viewport_height=1080
|
||||
window/stretch/mode="viewport"
|
||||
|
||||
[editor]
|
||||
@@ -50,6 +53,12 @@ player_down={
|
||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":1,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
player_jump={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"echo":false,"script":null)
|
||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
flick_up={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":-1.0,"script":null)
|
||||
@@ -70,6 +79,11 @@ flick_down={
|
||||
"events": [Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":-1,"axis":3,"axis_value":1.0,"script":null)
|
||||
]
|
||||
}
|
||||
player_taunt={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":3,"pressure":0.0,"pressed":true,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
extends Node2D
|
||||
|
||||
var game_arena :PackedScene= preload("res://game_arena.tscn")
|
||||
var game_arena :PackedScene= preload("res://3d_test.tscn")
|
||||
var scene_ref = null
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
|
||||
Reference in New Issue
Block a user