Merge pull request #421 from aaronfranke/platform-3d-animtree
Update Platformer 3D to use AnimationTree and organize into subfolders
@@ -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
|
||||
@@ -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 )
|
||||
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 122 KiB |
@@ -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
|
||||
@@ -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)
|
||||
@@ -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
|
||||
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 211 B After Width: | Height: | Size: 211 B |
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 815 B |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 836 B |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 819 B After Width: | Height: | Size: 819 B |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 819 B After Width: | Height: | Size: 819 B |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 842 B After Width: | Height: | Size: 842 B |
@@ -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]
|
||||
|
||||
@@ -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):
|
||||
@@ -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 )
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
sb_left.png
|
||||
sb_right.png
|
||||
sb_bottom.png
|
||||
sb_top.png
|
||||
sb_back.png
|
||||
sb_front.png
|
||||
|
||||
|
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
@@ -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]
|
||||
|
||||
312
3d/platformer/stage/stage.tscn
Normal file
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -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]
|
||||
|
||||
|
Before Width: | Height: | Size: 737 B After Width: | Height: | Size: 737 B |
@@ -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]
|
||||
|
||||
@@ -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 )
|
||||
@@ -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
|
||||