瀏覽代碼

Merge pull request #421 from aaronfranke/platform-3d-animtree

Update Platformer 3D to use AnimationTree and organize into subfolders
Aaron Franke 5 年之前
父節點
當前提交
de8a79b35b
共有 49 個文件被更改,包括 208 次插入263 次删除
  1. 1 1
      3d/platformer/coin/coin.gd
  2. 3 3
      3d/platformer/coin/coin.tscn
  3. 0 0
      3d/platformer/coin/sound_coin.wav
  4. 3 3
      3d/platformer/coin/sound_coin.wav.import
  5. 二進制
      3d/platformer/cutout.png
  6. 0 34
      3d/platformer/cutout.png.import
  7. 1 1
      3d/platformer/enemy/enemy.gd
  8. 5 5
      3d/platformer/enemy/enemy.tscn
  9. 0 0
      3d/platformer/enemy/robot_walk.wav
  10. 3 3
      3d/platformer/enemy/robot_walk.wav.import
  11. 0 0
      3d/platformer/enemy/shine.png
  12. 4 4
      3d/platformer/enemy/shine.png.import
  13. 0 0
      3d/platformer/enemy/sound_explode.wav
  14. 3 3
      3d/platformer/enemy/sound_explode.wav.import
  15. 0 0
      3d/platformer/enemy/sound_hit.wav
  16. 3 3
      3d/platformer/enemy/sound_hit.wav.import
  17. 0 0
      3d/platformer/player/bullet/bullet.gd
  18. 1 1
      3d/platformer/player/bullet/bullet.tscn
  19. 0 0
      3d/platformer/player/controls/osb_down.png
  20. 3 3
      3d/platformer/player/controls/osb_down.png.import
  21. 0 0
      3d/platformer/player/controls/osb_fire.png
  22. 3 3
      3d/platformer/player/controls/osb_fire.png.import
  23. 0 0
      3d/platformer/player/controls/osb_jump.png
  24. 3 3
      3d/platformer/player/controls/osb_jump.png.import
  25. 0 0
      3d/platformer/player/controls/osb_left.png
  26. 3 3
      3d/platformer/player/controls/osb_left.png.import
  27. 0 0
      3d/platformer/player/controls/osb_right.png
  28. 3 3
      3d/platformer/player/controls/osb_right.png.import
  29. 0 0
      3d/platformer/player/controls/osb_up.png
  30. 3 3
      3d/platformer/player/controls/osb_up.png.import
  31. 0 0
      3d/platformer/player/follow_camera.gd
  32. 11 18
      3d/platformer/player/player.gd
  33. 72 80
      3d/platformer/player/player.tscn
  34. 0 0
      3d/platformer/player/sound_jump.wav
  35. 3 3
      3d/platformer/player/sound_jump.wav.import
  36. 0 0
      3d/platformer/player/sound_shoot.wav
  37. 3 3
      3d/platformer/player/sound_shoot.wav.import
  38. 1 1
      3d/platformer/project.godot
  39. 0 7
      3d/platformer/sb.cube
  40. 0 59
      3d/platformer/stage.tscn
  41. 0 0
      3d/platformer/stage/panorama.png
  42. 3 3
      3d/platformer/stage/panorama.png.import
  43. 59 0
      3d/platformer/stage/stage.tscn
  44. 0 0
      3d/platformer/stage/texture.png
  45. 3 3
      3d/platformer/stage/texture.png.import
  46. 0 0
      3d/platformer/stage/texturemr.png
  47. 4 4
      3d/platformer/stage/texturemr.png.import
  48. 2 2
      3d/platformer/stage/tiles.tres
  49. 2 1
      3d/platformer/stage/tiles.tscn

+ 1 - 1
3d/platformer/coin.gd → 3d/platformer/coin/coin.gd

@@ -3,6 +3,6 @@ extends Area
 var taken = false
 
 func _on_coin_body_enter(body):
-	if not taken and body is preload("res://player.gd"):
+	if not taken and body is preload("res://player/player.gd"):
 		get_node("Animation").play("take")
 		taken = true

+ 3 - 3
3d/platformer/coin.tscn → 3d/platformer/coin/coin.tscn

@@ -1,8 +1,8 @@
 [gd_scene load_steps=14 format=2]
 
-[ext_resource path="res://coin.gd" type="Script" id=1]
-[ext_resource path="res://sound_coin.wav" type="AudioStream" id=2]
-[ext_resource path="res://shine.png" type="Texture" id=3]
+[ext_resource path="res://coin/coin.gd" type="Script" id=1]
+[ext_resource path="res://coin/sound_coin.wav" type="AudioStream" id=2]
+[ext_resource path="res://enemy/shine.png" type="Texture" id=3]
 
 [sub_resource type="SpatialMaterial" id=1]
 albedo_color = Color( 1, 0.837686, 0, 1 )

+ 0 - 0
3d/platformer/sound_coin.wav → 3d/platformer/coin/sound_coin.wav


+ 3 - 3
3d/platformer/sound_coin.wav.import → 3d/platformer/coin/sound_coin.wav.import

@@ -2,12 +2,12 @@
 
 importer="wav"
 type="AudioStreamSample"
-path="res://.import/sound_coin.wav-b4defacd1a1eab95585c7b5095506878.sample"
+path="res://.import/sound_coin.wav-5f523c825e94d407ed9e355cbe69ab46.sample"
 
 [deps]
 
-source_file="res://sound_coin.wav"
-dest_files=[ "res://.import/sound_coin.wav-b4defacd1a1eab95585c7b5095506878.sample" ]
+source_file="res://coin/sound_coin.wav"
+dest_files=[ "res://.import/sound_coin.wav-5f523c825e94d407ed9e355cbe69ab46.sample" ]
 
 [params]
 

二進制
3d/platformer/cutout.png


+ 0 - 34
3d/platformer/cutout.png.import

@@ -1,34 +0,0 @@
-[remap]
-
-importer="texture"
-type="StreamTexture"
-path="res://.import/cutout.png-8aacc6c936bf12e889c8e11f6c4eb91c.stex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://cutout.png"
-dest_files=[ "res://.import/cutout.png-8aacc6c936bf12e889c8e11f6c4eb91c.stex" ]
-
-[params]
-
-compress/mode=0
-compress/lossy_quality=0.7
-compress/hdr_mode=0
-compress/bptc_ldr=0
-compress/normal_map=0
-flags/repeat=0
-flags/filter=true
-flags/mipmaps=false
-flags/anisotropic=false
-flags/srgb=2
-process/fix_alpha_border=true
-process/premult_alpha=true
-process/HDR_as_SRGB=false
-process/invert_color=false
-stream=false
-size_limit=0
-detect_3d=true
-svg/scale=1.0

+ 1 - 1
3d/platformer/enemy.gd → 3d/platformer/enemy/enemy.gd

@@ -34,7 +34,7 @@ func _integrate_forces(state):
 		var dp = state.get_contact_local_normal(i)
 		
 		if cc:
-			if cc is preload("res://bullet.gd") and cc.enabled:
+			if cc is preload("res://player/bullet/bullet.gd") and cc.enabled:
 				set_mode(MODE_RIGID)
 				dying = true
 				state.set_angular_velocity(-dp.cross(up).normalized() * 33.0)

+ 5 - 5
3d/platformer/enemy.tscn → 3d/platformer/enemy/enemy.tscn

@@ -1,10 +1,10 @@
 [gd_scene load_steps=25 format=2]
 
-[ext_resource path="res://enemy.gd" type="Script" id=1]
-[ext_resource path="res://robot_walk.wav" type="AudioStream" id=2]
-[ext_resource path="res://sound_hit.wav" type="AudioStream" id=3]
-[ext_resource path="res://sound_explode.wav" type="AudioStream" id=4]
-[ext_resource path="res://shine.png" type="Texture" id=5]
+[ext_resource path="res://enemy/enemy.gd" type="Script" id=1]
+[ext_resource path="res://enemy/robot_walk.wav" type="AudioStream" id=2]
+[ext_resource path="res://enemy/sound_hit.wav" type="AudioStream" id=3]
+[ext_resource path="res://enemy/sound_explode.wav" type="AudioStream" id=4]
+[ext_resource path="res://enemy/shine.png" type="Texture" id=5]
 
 [sub_resource type="PhysicsMaterial" id=1]
 friction = 0.0

+ 0 - 0
3d/platformer/robot_walk.wav → 3d/platformer/enemy/robot_walk.wav


+ 3 - 3
3d/platformer/robot_walk.wav.import → 3d/platformer/enemy/robot_walk.wav.import

@@ -2,12 +2,12 @@
 
 importer="wav"
 type="AudioStreamSample"
-path="res://.import/robot_walk.wav-4313e7d5f563e62e3923080b14a79c15.sample"
+path="res://.import/robot_walk.wav-e477aac8926497af29eed244f64833e8.sample"
 
 [deps]
 
-source_file="res://robot_walk.wav"
-dest_files=[ "res://.import/robot_walk.wav-4313e7d5f563e62e3923080b14a79c15.sample" ]
+source_file="res://enemy/robot_walk.wav"
+dest_files=[ "res://.import/robot_walk.wav-e477aac8926497af29eed244f64833e8.sample" ]
 
 [params]
 

+ 0 - 0
3d/platformer/shine.png → 3d/platformer/enemy/shine.png


+ 4 - 4
3d/platformer/shine.png.import → 3d/platformer/enemy/shine.png.import

@@ -2,8 +2,8 @@
 
 importer="texture"
 type="StreamTexture"
-path.s3tc="res://.import/shine.png-a8253c1d2dc8acbf187823f695c13207.s3tc.stex"
-path.etc2="res://.import/shine.png-a8253c1d2dc8acbf187823f695c13207.etc2.stex"
+path.s3tc="res://.import/shine.png-4170bd0cee6f5d251a3f551d4acf3e6c.s3tc.stex"
+path.etc2="res://.import/shine.png-4170bd0cee6f5d251a3f551d4acf3e6c.etc2.stex"
 metadata={
 "imported_formats": [ "s3tc", "etc2" ],
 "vram_texture": true
@@ -11,8 +11,8 @@ metadata={
 
 [deps]
 
-source_file="res://shine.png"
-dest_files=[ "res://.import/shine.png-a8253c1d2dc8acbf187823f695c13207.s3tc.stex", "res://.import/shine.png-a8253c1d2dc8acbf187823f695c13207.etc2.stex" ]
+source_file="res://enemy/shine.png"
+dest_files=[ "res://.import/shine.png-4170bd0cee6f5d251a3f551d4acf3e6c.s3tc.stex", "res://.import/shine.png-4170bd0cee6f5d251a3f551d4acf3e6c.etc2.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/sound_explode.wav → 3d/platformer/enemy/sound_explode.wav


+ 3 - 3
3d/platformer/sound_explode.wav.import → 3d/platformer/enemy/sound_explode.wav.import

@@ -2,12 +2,12 @@
 
 importer="wav"
 type="AudioStreamSample"
-path="res://.import/sound_explode.wav-23e94be75a4346bffb517c7e07035977.sample"
+path="res://.import/sound_explode.wav-38875bfce76147e228902e26b716f579.sample"
 
 [deps]
 
-source_file="res://sound_explode.wav"
-dest_files=[ "res://.import/sound_explode.wav-23e94be75a4346bffb517c7e07035977.sample" ]
+source_file="res://enemy/sound_explode.wav"
+dest_files=[ "res://.import/sound_explode.wav-38875bfce76147e228902e26b716f579.sample" ]
 
 [params]
 

+ 0 - 0
3d/platformer/sound_hit.wav → 3d/platformer/enemy/sound_hit.wav


+ 3 - 3
3d/platformer/sound_hit.wav.import → 3d/platformer/enemy/sound_hit.wav.import

@@ -2,12 +2,12 @@
 
 importer="wav"
 type="AudioStreamSample"
-path="res://.import/sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.sample"
+path="res://.import/sound_hit.wav-954732368f39d5a47e196d428c1ff53a.sample"
 
 [deps]
 
-source_file="res://sound_hit.wav"
-dest_files=[ "res://.import/sound_hit.wav-d8455980ada2d4a9a73508948d7317cc.sample" ]
+source_file="res://enemy/sound_hit.wav"
+dest_files=[ "res://.import/sound_hit.wav-954732368f39d5a47e196d428c1ff53a.sample" ]
 
 [params]
 

+ 0 - 0
3d/platformer/bullet.gd → 3d/platformer/player/bullet/bullet.gd


+ 1 - 1
3d/platformer/bullet.tscn → 3d/platformer/player/bullet/bullet.tscn

@@ -1,6 +1,6 @@
 [gd_scene load_steps=10 format=2]
 
-[ext_resource path="res://bullet.gd" type="Script" id=1]
+[ext_resource path="res://player/bullet/bullet.gd" type="Script" id=1]
 
 [sub_resource type="SpatialMaterial" id=1]
 flags_transparent = true

+ 0 - 0
3d/platformer/osb_down.png → 3d/platformer/player/controls/osb_down.png


+ 3 - 3
3d/platformer/osb_down.png.import → 3d/platformer/player/controls/osb_down.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/osb_down.png-4a1ab934f787719766862b499528d054.stex"
+path="res://.import/osb_down.png-3bcabfc1fcfaeeccc61e2e829d6554c4.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://osb_down.png"
-dest_files=[ "res://.import/osb_down.png-4a1ab934f787719766862b499528d054.stex" ]
+source_file="res://player/controls/osb_down.png"
+dest_files=[ "res://.import/osb_down.png-3bcabfc1fcfaeeccc61e2e829d6554c4.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/osb_fire.png → 3d/platformer/player/controls/osb_fire.png


+ 3 - 3
3d/platformer/osb_fire.png.import → 3d/platformer/player/controls/osb_fire.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.stex"
+path="res://.import/osb_fire.png-2e93a3da4bfeb57477fca7905c0173a4.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://osb_fire.png"
-dest_files=[ "res://.import/osb_fire.png-e657a73546eb75918e9d9a3fea15cf70.stex" ]
+source_file="res://player/controls/osb_fire.png"
+dest_files=[ "res://.import/osb_fire.png-2e93a3da4bfeb57477fca7905c0173a4.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/osb_jump.png → 3d/platformer/player/controls/osb_jump.png


+ 3 - 3
3d/platformer/osb_jump.png.import → 3d/platformer/player/controls/osb_jump.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.stex"
+path="res://.import/osb_jump.png-aa75300abbd0a7d9e9bc4796371c64a3.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://osb_jump.png"
-dest_files=[ "res://.import/osb_jump.png-dbbef3b47abbb562ce6c81a9701121c6.stex" ]
+source_file="res://player/controls/osb_jump.png"
+dest_files=[ "res://.import/osb_jump.png-aa75300abbd0a7d9e9bc4796371c64a3.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/osb_left.png → 3d/platformer/player/controls/osb_left.png


+ 3 - 3
3d/platformer/osb_left.png.import → 3d/platformer/player/controls/osb_left.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/osb_left.png-fc7230aeb0eec74933ed08f89b893288.stex"
+path="res://.import/osb_left.png-10e92e56ebe36a5205968909dc4b286b.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://osb_left.png"
-dest_files=[ "res://.import/osb_left.png-fc7230aeb0eec74933ed08f89b893288.stex" ]
+source_file="res://player/controls/osb_left.png"
+dest_files=[ "res://.import/osb_left.png-10e92e56ebe36a5205968909dc4b286b.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/osb_right.png → 3d/platformer/player/controls/osb_right.png


+ 3 - 3
3d/platformer/osb_right.png.import → 3d/platformer/player/controls/osb_right.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.stex"
+path="res://.import/osb_right.png-fb8adc0d65f2da35441a371b0865044c.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://osb_right.png"
-dest_files=[ "res://.import/osb_right.png-5cf5add2dbc1c8dde17173ac56f3a004.stex" ]
+source_file="res://player/controls/osb_right.png"
+dest_files=[ "res://.import/osb_right.png-fb8adc0d65f2da35441a371b0865044c.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/osb_up.png → 3d/platformer/player/controls/osb_up.png


+ 3 - 3
3d/platformer/osb_up.png.import → 3d/platformer/player/controls/osb_up.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/osb_up.png-6a05b6a7bf0ede3756308a5cffdd2b9a.stex"
+path="res://.import/osb_up.png-03a826da4884734d6f66c813539bfce8.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://osb_up.png"
-dest_files=[ "res://.import/osb_up.png-6a05b6a7bf0ede3756308a5cffdd2b9a.stex" ]
+source_file="res://player/controls/osb_up.png"
+dest_files=[ "res://.import/osb_up.png-03a826da4884734d6f66c813539bfce8.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/follow_camera.gd → 3d/platformer/player/follow_camera.gd


+ 11 - 18
3d/platformer/player.gd → 3d/platformer/player/player.gd

@@ -1,15 +1,13 @@
 extends KinematicBody
 
 const ANIM_FLOOR = 0
-const ANIM_AIR_UP = 1
-const ANIM_AIR_DOWN = 2
+const ANIM_AIR = 1
 
 const SHOOT_TIME = 1.5
 const SHOOT_SCALE = 2
 const CHAR_SCALE = Vector3(0.3, 0.3, 0.3)
 const TURN_SPEED = 40
 
-var facing_dir = Vector3.RIGHT
 var movement_dir = Vector3()
 var linear_velocity = Vector3()
 
@@ -27,7 +25,7 @@ var shoot_blend = 0
 onready var gravity = ProjectSettings.get_setting("physics/3d/default_gravity") * ProjectSettings.get_setting("physics/3d/default_gravity_vector")
 
 func _ready():
-	get_node("AnimationTreePlayer").set_active(true)
+	get_node("AnimationTree").set_active(true)
 
 
 func _physics_process(delta):
@@ -41,13 +39,11 @@ func _physics_process(delta):
 	var hdir = hv.normalized() # Horizontal direction.
 	var hspeed = hv.length() # Horizontal speed.
 	
-	# Player input
+	# Player input.
 	var cam_basis = get_node("Target/Camera").get_global_transform().basis
 	var dir = Vector3() # Where does the player intend to walk to.
-	dir = Input.get_action_strength("move_right") * cam_basis[0]
-	dir -= Input.get_action_strength("move_left") * cam_basis[0]
-	dir += Input.get_action_strength("move_backwards") * cam_basis[2]
-	dir -= Input.get_action_strength("move_forward") * cam_basis[2]
+	dir = (Input.get_action_strength("move_right") - Input.get_action_strength("move_left")) * cam_basis[0]
+	dir += (Input.get_action_strength("move_backwards") - Input.get_action_strength("move_forward")) * cam_basis[2]
 	dir.y = 0
 	dir = dir.normalized()
 	
@@ -60,7 +56,6 @@ func _physics_process(delta):
 		if dir.length() > 0.1 and !sharp_turn:
 			if hspeed > 0.001:
 				hdir = adjust_facing(hdir, dir, delta, 1.0 / hspeed * TURN_SPEED, Vector3.UP)
-				facing_dir = hdir
 			else:
 				hdir = dir
 			
@@ -88,10 +83,7 @@ func _physics_process(delta):
 			jumping = true
 			get_node("SoundJump").play()
 	else:
-		if vv > 0:
-			anim = ANIM_AIR_UP
-		else:
-			anim = ANIM_AIR_DOWN
+		anim = ANIM_AIR
 		
 		if dir.length() > 0.1:
 			hv += dir * (accel * 0.2 * delta)
@@ -121,7 +113,7 @@ func _physics_process(delta):
 	
 	if shoot_attempt and not prev_shoot:
 		shoot_blend = SHOOT_TIME
-		var bullet = preload("res://bullet.tscn").instance()
+		var bullet = preload("res://player/bullet/bullet.tscn").instance()
 		bullet.set_transform(get_node("Armature/Bullet").get_global_transform().orthonormalized())
 		get_parent().add_child(bullet)
 		bullet.set_linear_velocity(get_node("Armature/Bullet").get_global_transform().basis[2].normalized() * 20)
@@ -131,10 +123,11 @@ func _physics_process(delta):
 	prev_shoot = shoot_attempt
 	
 	if is_on_floor():
-		get_node("AnimationTreePlayer").blend2_node_set_amount("walk", hspeed / max_speed)
+		$AnimationTree["parameters/walk/blend_amount"] = hspeed / max_speed
 	
-	get_node("AnimationTreePlayer").transition_node_set_current("state", anim)
-	get_node("AnimationTreePlayer").blend2_node_set_amount("gun", min(shoot_blend, 1.0))
+	$AnimationTree["parameters/state/current"] = anim
+	$AnimationTree["parameters/air_dir/blend_amount"] = clamp(-linear_velocity.y / 4 + 0.5, 0, 1)
+	$AnimationTree["parameters/gun/blend_amount"] = min(shoot_blend, 1.0)
 
 
 func adjust_facing(p_facing, p_target, p_step, p_adjust_rate, current_gn):

+ 72 - 80
3d/platformer/player.tscn → 3d/platformer/player/player.tscn

@@ -1,13 +1,13 @@
-[gd_scene load_steps=21 format=2]
+[gd_scene load_steps=32 format=2]
 
-[ext_resource path="res://player.gd" type="Script" id=1]
-[ext_resource path="res://follow_camera.gd" type="Script" id=2]
-[ext_resource path="res://osb_up.png" type="Texture" id=3]
-[ext_resource path="res://osb_down.png" type="Texture" id=4]
-[ext_resource path="res://osb_left.png" type="Texture" id=5]
-[ext_resource path="res://osb_right.png" type="Texture" id=6]
-[ext_resource path="res://sound_shoot.wav" type="AudioStream" id=7]
-[ext_resource path="res://sound_jump.wav" type="AudioStream" id=8]
+[ext_resource path="res://player/player.gd" type="Script" id=1]
+[ext_resource path="res://player/follow_camera.gd" type="Script" id=2]
+[ext_resource path="res://player/controls/osb_up.png" type="Texture" id=3]
+[ext_resource path="res://player/controls/osb_down.png" type="Texture" id=4]
+[ext_resource path="res://player/controls/osb_left.png" type="Texture" id=5]
+[ext_resource path="res://player/controls/osb_right.png" type="Texture" id=6]
+[ext_resource path="res://player/sound_shoot.wav" type="AudioStream" id=7]
+[ext_resource path="res://player/sound_jump.wav" type="AudioStream" id=8]
 
 [sub_resource type="CapsuleShape" id=1]
 radius = 0.4
@@ -1603,6 +1603,61 @@ tracks/26/imported = false
 tracks/26/enabled = true
 tracks/26/keys = PoolRealArray( 0, 1, 5.17831e-08, 0.00292331, 0.204329, 3.25963e-09, -2.17324e-11, 3.00563e-10, 1, 1, 1, 1, 1.25, 1, 5.17831e-08, 0.00292331, 0.204329, 3.25963e-09, -2.17324e-11, 3.00563e-10, 1, 1, 1, 1 )
 
+[sub_resource type="AnimationNodeAnimation" id=13]
+animation = "walk-cycle"
+
+[sub_resource type="AnimationNodeAnimation" id=14]
+animation = "jump-up-cycle"
+
+[sub_resource type="AnimationNodeAnimation" id=15]
+animation = "falling-cycle"
+
+[sub_resource type="AnimationNodeAnimation" id=16]
+animation = "shooting_standing"
+
+[sub_resource type="AnimationNodeAnimation" id=17]
+animation = "idle"
+
+[sub_resource type="AnimationNodeBlend2" id=18]
+
+[sub_resource type="AnimationNodeBlend2" id=19]
+
+[sub_resource type="AnimationNodeTimeScale" id=20]
+
+[sub_resource type="AnimationNodeTransition" id=21]
+input_count = 2
+input_0/name = "on floor"
+input_0/auto_advance = false
+input_1/name = "in air"
+input_1/auto_advance = false
+
+[sub_resource type="AnimationNodeBlend2" id=22]
+
+[sub_resource type="AnimationNodeBlendTree" id=23]
+graph_offset = Vector2( -294.243, -77.71 )
+nodes/Animation/node = SubResource( 17 )
+nodes/Animation/position = Vector2( -260, -280 )
+"nodes/Animation 2/node" = SubResource( 13 )
+"nodes/Animation 2/position" = Vector2( -260, -160 )
+"nodes/Animation 3/node" = SubResource( 14 )
+"nodes/Animation 3/position" = Vector2( -260, -40 )
+"nodes/Animation 4/node" = SubResource( 15 )
+"nodes/Animation 4/position" = Vector2( -260, 80 )
+"nodes/Animation 5/node" = SubResource( 16 )
+"nodes/Animation 5/position" = Vector2( -260, 200 )
+nodes/air_dir/node = SubResource( 18 )
+nodes/air_dir/position = Vector2( 140, 20 )
+nodes/gun/node = SubResource( 19 )
+nodes/gun/position = Vector2( 680, 140 )
+nodes/output/position = Vector2( 880, 140 )
+nodes/scale/node = SubResource( 20 )
+nodes/scale/position = Vector2( 180, -120 )
+nodes/state/node = SubResource( 21 )
+nodes/state/position = Vector2( 440, 0 )
+nodes/walk/node = SubResource( 22 )
+nodes/walk/position = Vector2( -40, -240 )
+node_connections = [ "scale", 0, "walk", "output", 0, "gun", "state", 0, "scale", "state", 1, "air_dir", "air_dir", 0, "Animation 3", "air_dir", 1, "Animation 4", "gun", 0, "state", "gun", 1, "Animation 5", "walk", 0, "Animation", "walk", 1, "Animation 2" ]
+
 [node name="Player" type="KinematicBody"]
 script = ExtResource( 1 )
 __meta__ = {
@@ -1781,77 +1836,14 @@ anims/shooting = SubResource( 10 )
 anims/shooting_standing = SubResource( 11 )
 anims/walk-cycle = SubResource( 12 )
 
-[node name="AnimationTreePlayer" type="AnimationTreePlayer" parent="."]
-master_player = NodePath("../AnimationPlayer")
-data = {
-"active": false,
-"connections": [ "walk", "scale", 0, "scale", "state", 0, "anim 3", "state", 1, "anim 4", "state", 2, "gun", "out", 0, "state", "gun", 0, "anim 5", "gun", 1, "anim", "walk", 0, "anim 2", "walk", 1 ],
-"master": NodePath("../AnimationPlayer"),
-"nodes": [ {
-"id": "scale",
-"position": Vector2( 450, 278 ),
-"scale": 1.2,
-"type": "timescale"
-}, {
-"id": "state",
-"position": Vector2( 610, 374 ),
-"transitions": [ {
-"auto_advance": false
-}, {
-"auto_advance": false
-}, {
-"auto_advance": false
-} ],
-"type": "transition",
-"xfade": 0.1
-}, {
-"filter": [  ],
-"from": "idle",
-"id": "anim",
-"position": Vector2( 44, 94 ),
-"type": "animation"
-}, {
-"id": "out",
-"position": Vector2( 960, 322 ),
-"type": "output"
-}, {
-"filter": [  ],
-"from": "shooting_standing",
-"id": "anim 5",
-"position": Vector2( 47, 528 ),
-"type": "animation"
-}, {
-"filter": [  ],
-"from": "jump-up-cycle",
-"id": "anim 3",
-"position": Vector2( 45, 311 ),
-"type": "animation"
-}, {
-"blend": 1.0,
-"filter": [ NodePath("Armature/Skeleton:r-foot"), NodePath("Armature/Skeleton:r-leg"), NodePath("Armature/Skeleton:waist"), NodePath("Armature/Skeleton:r-ARMCONTROL"), NodePath("Armature/Skeleton:r-ARMORIENT"), NodePath("Armature/Skeleton:r-LEGCONTROL"), NodePath("Armature/Skeleton:r-LEGORIENT"), NodePath("Armature/Skeleton:hip"), NodePath("Armature/Skeleton:l-foot"), NodePath("Armature/Skeleton:l-leg"), NodePath("Armature/Skeleton:neck"), NodePath("Armature/Skeleton:l-ARMCONTROL"), NodePath("Armature/Skeleton:l-ARMORIENT"), NodePath("Armature/Skeleton:l-LEGCONTROL"), NodePath("Armature/Skeleton:l-LEGORIENT"), NodePath("Armature/Skeleton:HEAD"), NodePath("Armature/Skeleton:head"), NodePath("Armature/Skeleton:r-thigh"), NodePath("Armature/Skeleton:MASTER"), NodePath("Armature/Skeleton:l-thigh"), NodePath("Armature"), NodePath("Armature/Skeleton:headtracker") ],
-"id": "gun",
-"position": Vector2( 779, 489 ),
-"type": "blend2"
-}, {
-"filter": [  ],
-"from": "walk-cycle",
-"id": "anim 2",
-"position": Vector2( 44, 202 ),
-"type": "animation"
-}, {
-"filter": [  ],
-"from": "falling-cycle",
-"id": "anim 4",
-"position": Vector2( 46, 419 ),
-"type": "animation"
-}, {
-"blend": 1.0,
-"filter": [  ],
-"id": "walk",
-"position": Vector2( 309, 182 ),
-"type": "blend2"
-} ]
-}
+[node name="AnimationTree" type="AnimationTree" parent="."]
+tree_root = SubResource( 23 )
+anim_player = NodePath("../AnimationPlayer")
+parameters/air_dir/blend_amount = 0.0
+parameters/gun/blend_amount = 0
+parameters/scale/scale = 1.2
+parameters/state/current = 0
+parameters/walk/blend_amount = 0.0
 
 [node name="Forward" type="TouchScreenButton" parent="."]
 position = Vector2( 72, 301 )

+ 0 - 0
3d/platformer/sound_jump.wav → 3d/platformer/player/sound_jump.wav


+ 3 - 3
3d/platformer/sound_jump.wav.import → 3d/platformer/player/sound_jump.wav.import

@@ -2,12 +2,12 @@
 
 importer="wav"
 type="AudioStreamSample"
-path="res://.import/sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.sample"
+path="res://.import/sound_jump.wav-2a6db8acfd21d20a55b2f160c322e83f.sample"
 
 [deps]
 
-source_file="res://sound_jump.wav"
-dest_files=[ "res://.import/sound_jump.wav-4966d1f327e26a176b56ab335c03b5e1.sample" ]
+source_file="res://player/sound_jump.wav"
+dest_files=[ "res://.import/sound_jump.wav-2a6db8acfd21d20a55b2f160c322e83f.sample" ]
 
 [params]
 

+ 0 - 0
3d/platformer/sound_shoot.wav → 3d/platformer/player/sound_shoot.wav


+ 3 - 3
3d/platformer/sound_shoot.wav.import → 3d/platformer/player/sound_shoot.wav.import

@@ -2,12 +2,12 @@
 
 importer="wav"
 type="AudioStreamSample"
-path="res://.import/sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.sample"
+path="res://.import/sound_shoot.wav-1364cf87a9be9d98fd06fa6e8c50c93c.sample"
 
 [deps]
 
-source_file="res://sound_shoot.wav"
-dest_files=[ "res://.import/sound_shoot.wav-f0f26619cba21d411b53ad23b8788116.sample" ]
+source_file="res://player/sound_shoot.wav"
+dest_files=[ "res://.import/sound_shoot.wav-1364cf87a9be9d98fd06fa6e8c50c93c.sample" ]
 
 [params]
 

+ 1 - 1
3d/platformer/project.godot

@@ -16,7 +16,7 @@ _global_script_class_icons={
 [application]
 
 config/name="Platformer 3D"
-run/main_scene="res://stage.tscn"
+run/main_scene="res://stage/stage.tscn"
 config/icon="res://icon.png"
 
 [gdnative]

+ 0 - 7
3d/platformer/sb.cube

@@ -1,7 +0,0 @@
-sb_left.png
-sb_right.png
-sb_bottom.png
-sb_top.png
-sb_back.png
-sb_front.png
-

文件差異過大導致無法顯示
+ 0 - 59
3d/platformer/stage.tscn


+ 0 - 0
3d/platformer/panorama.png → 3d/platformer/stage/panorama.png


+ 3 - 3
3d/platformer/panorama.png.import → 3d/platformer/stage/panorama.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/panorama.png-e05131d3dca9fd5b03101f18fbe08995.stex"
+path="res://.import/panorama.png-831ab5eba634fd570693d2002d1da17a.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://panorama.png"
-dest_files=[ "res://.import/panorama.png-e05131d3dca9fd5b03101f18fbe08995.stex" ]
+source_file="res://stage/panorama.png"
+dest_files=[ "res://.import/panorama.png-831ab5eba634fd570693d2002d1da17a.stex" ]
 
 [params]
 

文件差異過大導致無法顯示
+ 59 - 0
3d/platformer/stage/stage.tscn


+ 0 - 0
3d/platformer/texture.png → 3d/platformer/stage/texture.png


+ 3 - 3
3d/platformer/texture.png.import → 3d/platformer/stage/texture.png.import

@@ -2,15 +2,15 @@
 
 importer="texture"
 type="StreamTexture"
-path="res://.import/texture.png-77dc6ecaf884a35cd9dbaf886cacc46d.stex"
+path="res://.import/texture.png-d5a77cb2808c1bf5b0612979ad94fbdb.stex"
 metadata={
 "vram_texture": false
 }
 
 [deps]
 
-source_file="res://texture.png"
-dest_files=[ "res://.import/texture.png-77dc6ecaf884a35cd9dbaf886cacc46d.stex" ]
+source_file="res://stage/texture.png"
+dest_files=[ "res://.import/texture.png-d5a77cb2808c1bf5b0612979ad94fbdb.stex" ]
 
 [params]
 

+ 0 - 0
3d/platformer/texturemr.png → 3d/platformer/stage/texturemr.png


+ 4 - 4
3d/platformer/texturemr.png.import → 3d/platformer/stage/texturemr.png.import

@@ -2,8 +2,8 @@
 
 importer="texture"
 type="StreamTexture"
-path.s3tc="res://.import/texturemr.png-0568a8b09834741143da53ce460e36f1.s3tc.stex"
-path.etc2="res://.import/texturemr.png-0568a8b09834741143da53ce460e36f1.etc2.stex"
+path.s3tc="res://.import/texturemr.png-93ff7bda7acbc5334b4181300007df27.s3tc.stex"
+path.etc2="res://.import/texturemr.png-93ff7bda7acbc5334b4181300007df27.etc2.stex"
 metadata={
 "imported_formats": [ "s3tc", "etc2" ],
 "vram_texture": true
@@ -11,8 +11,8 @@ metadata={
 
 [deps]
 
-source_file="res://texturemr.png"
-dest_files=[ "res://.import/texturemr.png-0568a8b09834741143da53ce460e36f1.s3tc.stex", "res://.import/texturemr.png-0568a8b09834741143da53ce460e36f1.etc2.stex" ]
+source_file="res://stage/texturemr.png"
+dest_files=[ "res://.import/texturemr.png-93ff7bda7acbc5334b4181300007df27.s3tc.stex", "res://.import/texturemr.png-93ff7bda7acbc5334b4181300007df27.etc2.stex" ]
 
 [params]
 

+ 2 - 2
3d/platformer/tiles.tres → 3d/platformer/stage/tiles.tres

@@ -1,7 +1,7 @@
 [gd_resource type="MeshLibrary" load_steps=76 format=2]
 
-[ext_resource path="res://texture.png" type="Texture" id=1]
-[ext_resource path="res://texturemr.png" type="Texture" id=2]
+[ext_resource path="res://stage/texture.png" type="Texture" id=1]
+[ext_resource path="res://stage/texturemr.png" type="Texture" id=2]
 
 [sub_resource type="SpatialMaterial" id=1]
 albedo_texture = ExtResource( 1 )

+ 2 - 1
3d/platformer/tiles.tscn → 3d/platformer/stage/tiles.tscn

@@ -1,6 +1,7 @@
 [gd_scene load_steps=22 format=2]
 
-[ext_resource path="res://texture.png" type="Texture" id=1]
+[ext_resource path="res://stage/texture.png" type="Texture" id=1]
+
 
 [sub_resource type="SpatialMaterial" id=1]
 params_diffuse_mode = 1

部分文件因文件數量過多而無法顯示