Compare commits

...

9 Commits

Author SHA1 Message Date
Rémi Verschelde
5fe6147a34 Add gitignore 2017-07-15 12:34:17 +02:00
Rémi Verschelde
4621cbd2d3 Tween Demo: Fix sprite and color pickers display 2017-07-15 12:33:34 +02:00
Rémi Verschelde
cbccc3a3da Allow changing player facing side while in the air
* As soon as the user wants to change direction while in the air, change
  the character's facing side.
* This allows for example shooting left then right while in the air and
  gives a better feeling.

Adapted from @stormi's 8ff2aec4f1.
2017-04-11 22:24:27 +02:00
Mario Schlack
491aef3974 Added Input.set_mouse_mode(...) test cases.
(cherry picked from commit ee75abef10)
2017-01-21 16:32:42 +01:00
Rémi Verschelde
67313fc1be Merge pull request #34 from Faless/split_screen_rebased
Backport split screen platformer to 2.1 compatibile API
2017-01-19 11:19:33 +01:00
Fabio Alessandrelli
ed6ae9dc2f Implement split screen in "Split Screen Platformer" 2017-01-14 02:14:19 +01:00
Fabio Alessandrelli
5260eeabc7 Copy 2D platformer code to new split screen platformer folder 2017-01-14 02:14:08 +01:00
Rémi Verschelde
f18d5d02c3 Remove empty inverse kinematics demo
Fixes #27.

(cherry picked from commit 50895875ed)
2016-12-04 11:29:26 +01:00
William Tumeo
ed9494f251 free coin in 3D platformer
(cherry picked from commit 76bfb10deb)
2016-11-16 19:17:44 +01:00
64 changed files with 3787 additions and 24 deletions

8
.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
# System/tool-specific ignores
.directory
*~

View File

@@ -119,6 +119,14 @@ func _integrate_forces(s):
# Process jump
if (jumping):
# We want the character to immediately change facing side when the player
# tries to change direction, during air control.
# This allows for example the player to shoot quickly left then right.
if (move_left and not move_right):
get_node("sprite").set_scale(Vector2(-1, 1))
if (move_right and not move_left):
get_node("sprite").set_scale(Vector2(1, 1))
if (lv.y > 0):
# Set off the jumping flag if going down
jumping = false

View File

@@ -0,0 +1,16 @@
extends RigidBody2D
# Member variables
var disabled = false
func disable():
if (disabled):
return
get_node("anim").play("shutdown")
disabled = true
func _ready():
get_node("Timer").start()

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

View File

@@ -0,0 +1,115 @@
[gd_scene load_steps=6 format=1]
[ext_resource path="res://bullet.gd" type="Script" id=1]
[ext_resource path="res://bullet.png" type="Texture" id=2]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 10.0
[sub_resource type="ColorRamp" id=2]
offsets = FloatArray( 0, 1 )
colors = ColorArray( 1, 1, 1, 1, 1, 0, 0, 0 )
[sub_resource type="Animation" id=3]
length = 1.5
loop = false
step = 0.0
tracks/0/type = "value"
tracks/0/path = NodePath("particles:config/emitting")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ false ] }
tracks/1/type = "value"
tracks/1/path = NodePath("sprite:visibility/self_opacity")
tracks/1/interp = 1
tracks/1/keys = { "cont":true, "times":FloatArray( 0, 1.00394 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
tracks/2/type = "method"
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/keys = { "times":FloatArray( 1.31 ), "transitions":FloatArray( 1 ), "values":[ { "args":[ ], "method":"queue_free" } ] }
[node name="bullet" type="RigidBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 0
mass = 1.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 2
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
script/script = ExtResource( 1 )
[node name="particles" type="Particles2D" parent="."]
visibility/opacity = 0.559322
visibility/blend_mode = 1
config/amount = 24
config/lifetime = 0.1
config/local_space = false
config/texture = ExtResource( 2 )
params/direction = 0.0
params/spread = 10.0
params/linear_velocity = 0.0
params/spin_velocity = 0.0
params/orbit_velocity = 0.0
params/gravity_direction = 0.0
params/gravity_strength = 0.0
params/radial_accel = 0.0
params/tangential_accel = 0.0
params/damping = 0.0
params/initial_angle = 0.0
params/initial_size = 1.0
params/final_size = 0.0
params/hue_variation = 0.0
params/anim_speed_scale = 1.0
params/anim_initial_pos = 0.0
color/color_ramp = SubResource( 2 )
[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="Timer" type="Timer" parent="."]
process_mode = 1
wait_time = 1.0
one_shot = true
autostart = false
[node name="anim" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/shutdown = SubResource( 3 )
playback/active = true
playback/speed = 1.0
blend_times = [ ]
autoplay = ""
[connection signal="timeout" from="Timer" to="." method="disable"]

View File

@@ -0,0 +1,19 @@
extends Area2D
# Member variables
var taken = false
func _on_body_enter( body ):
if (not taken and body extends preload("res://player.gd")):
get_node("anim").play("taken")
taken = true
func _on_coin_area_enter(area):
pass # replace with function body
func _on_coin_area_enter_shape(area_id, area, area_shape, area_shape):
pass # replace with function body

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,146 @@
[gd_scene load_steps=10 format=1]
[ext_resource path="res://coin.gd" type="Script" id=1]
[ext_resource path="res://coin.png" type="Texture" id=2]
[ext_resource path="res://sound_coin.wav" type="Sample" id=3]
[ext_resource path="res://bullet.png" type="Texture" id=4]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 10.0
[sub_resource type="Animation" id=2]
resource/name = "spin"
length = 1.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1 ), "values":[ 0, 1, 2, 3, 2, 1, 0 ] }
[sub_resource type="Animation" id=3]
length = 8.0
loop = false
step = 0.0
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":true, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ 0 ] }
tracks/1/type = "value"
tracks/1/path = NodePath("sound:play/play")
tracks/1/interp = 1
tracks/1/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ "coin" ] }
tracks/2/type = "value"
tracks/2/path = NodePath("particles:visibility/self_opacity")
tracks/2/interp = 1
tracks/2/keys = { "cont":true, "times":FloatArray( 0, 1.66 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
tracks/3/type = "value"
tracks/3/path = NodePath("sprite:visibility/self_opacity")
tracks/3/interp = 1
tracks/3/keys = { "cont":true, "times":FloatArray( 0, 0.4 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
tracks/4/type = "value"
tracks/4/path = NodePath("particles:config/emitting")
tracks/4/interp = 1
tracks/4/keys = { "cont":false, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ true ] }
tracks/5/type = "method"
tracks/5/path = NodePath(".")
tracks/5/interp = 1
tracks/5/keys = { "times":FloatArray( 2.7 ), "transitions":FloatArray( 1 ), "values":[ { "args":[ ], "method":"queue_free" } ] }
[sub_resource type="SampleLibrary" id=4]
samples/coin = { "db":0.0, "pitch":1.0, "sample":ExtResource( 3 ) }
[sub_resource type="ColorRamp" id=5]
offsets = FloatArray( 0, 1 )
colors = ColorArray( 1, 1, 1, 1, 0, 0, 0, 1 )
[node name="coin" type="Area2D"]
input/pickable = true
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
gravity_vec = Vector2( 0, 1 )
gravity = 98.0
linear_damp = 0.1
angular_damp = 1.0
script/script = ExtResource( 1 )
[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
hframes = 4
[node name="anim" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/spin = SubResource( 2 )
anims/taken = SubResource( 3 )
playback/active = true
playback/speed = 3.0
blend_times = [ ]
autoplay = "spin"
[node name="collision" type="CollisionShape2D" parent="."]
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="sound" type="SamplePlayer2D" parent="."]
params/volume_db = 0.0
params/pitch_scale = 1.0
params/attenuation/min_distance = 1.0
params/attenuation/max_distance = 2048.0
params/attenuation/distance_exp = 1.0
config/polyphony = 1
config/samples = SubResource( 4 )
config/pitch_random = 0.0
[node name="particles" type="Particles2D" parent="."]
visibility/blend_mode = 1
config/amount = 8
config/lifetime = 0.4
config/emitting = false
config/half_extents = Vector2( 5, 5 )
config/texture = ExtResource( 4 )
params/direction = 0.0
params/spread = 10.0
params/linear_velocity = 0.0
params/spin_velocity = 0.0
params/orbit_velocity = 0.0
params/gravity_direction = 0.0
params/gravity_strength = 0.0
params/radial_accel = 0.0
params/tangential_accel = 0.0
params/damping = 0.0
params/initial_angle = 0.0
params/initial_size = 0.2
params/final_size = 0.2
params/hue_variation = 0.0
params/anim_speed_scale = 1.0
params/anim_initial_pos = 0.0
color/color_ramp = SubResource( 5 )
[node name="enabler" type="VisibilityEnabler2D" parent="."]
rect = Rect2( -10, -10, 20, 20 )
enabler/pause_animations = true
enabler/freeze_bodies = true
enabler/pause_particles = true
enabler/process_parent = false
enabler/fixed_process_parent = false
[connection signal="body_enter" from="." to="." method="_on_body_enter"]

View File

@@ -0,0 +1,83 @@
extends RigidBody2D
# Member variables
const STATE_WALKING = 0
const STATE_DYING = 1
var state = STATE_WALKING
var direction = -1
var anim = ""
var rc_left = null
var rc_right = null
var WALK_SPEED = 50
var bullet_class = preload("res://bullet.gd")
func _die():
queue_free()
func _pre_explode():
# Stay there
clear_shapes()
set_mode(MODE_STATIC)
get_node("sound").play("explode")
func _integrate_forces(s):
var lv = s.get_linear_velocity()
var new_anim = anim
if (state == STATE_DYING):
new_anim = "explode"
elif (state == STATE_WALKING):
new_anim = "walk"
var wall_side = 0.0
for i in range(s.get_contact_count()):
var cc = s.get_contact_collider_object(i)
var dp = s.get_contact_local_normal(i)
if (cc):
if (cc extends bullet_class and not cc.disabled):
set_mode(MODE_RIGID)
state = STATE_DYING
#lv = s.get_contact_local_normal(i)*400
s.set_angular_velocity(sign(dp.x)*33.0)
set_friction(1)
cc.disable()
get_node("sound").play("hit")
break
if (dp.x > 0.9):
wall_side = 1.0
elif (dp.x < -0.9):
wall_side = -1.0
if (wall_side != 0 and wall_side != direction):
direction = -direction
get_node("sprite").set_scale(Vector2(-direction, 1))
if (direction < 0 and not rc_left.is_colliding() and rc_right.is_colliding()):
direction = -direction
get_node("sprite").set_scale(Vector2(-direction, 1))
elif (direction > 0 and not rc_right.is_colliding() and rc_left.is_colliding()):
direction = -direction
get_node("sprite").set_scale(Vector2(-direction, 1))
lv.x = direction*WALK_SPEED
if(anim != new_anim):
anim = new_anim
get_node("anim").play(anim)
s.set_linear_velocity(lv)
func _ready():
rc_left = get_node("raycast_left")
rc_right = get_node("raycast_right")

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,206 @@
[gd_scene load_steps=12 format=1]
[ext_resource path="res://enemy.gd" type="Script" id=1]
[ext_resource path="res://enemy.png" type="Texture" id=2]
[ext_resource path="res://bullet.png" type="Texture" id=3]
[ext_resource path="res://sound_explode.wav" type="Sample" id=4]
[ext_resource path="res://sound_hit.wav" type="Sample" id=5]
[sub_resource type="CircleShape2D" id=1]
custom_solver_bias = 0.0
radius = 14.0
[sub_resource type="Animation" id=2]
resource/name = "explode"
length = 6.0
loop = false
step = 0.0
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:visibility/self_opacity")
tracks/0/interp = 1
tracks/0/keys = { "cont":true, "times":FloatArray( 3.58422, 4.33851 ), "transitions":FloatArray( 1, 1 ), "values":[ 1.0, 0.0 ] }
tracks/1/type = "value"
tracks/1/path = NodePath("sprite:frame")
tracks/1/interp = 1
tracks/1/keys = { "cont":true, "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "values":[ 4 ] }
tracks/2/type = "value"
tracks/2/path = NodePath("Particles2D:config/emitting")
tracks/2/interp = 1
tracks/2/keys = { "cont":false, "times":FloatArray( 3.47394 ), "transitions":FloatArray( 1 ), "values":[ true ] }
tracks/3/type = "method"
tracks/3/path = NodePath(".")
tracks/3/interp = 1
tracks/3/keys = { "times":FloatArray( 3.20357, 5.07305 ), "transitions":FloatArray( 1, 1 ), "values":[ { "args":[ ], "method":"_pre_explode" }, { "args":[ ], "method":"_die" } ] }
[sub_resource type="Animation" id=3]
length = 6.75
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.75, 1.5, 2.25, 3, 3.75, 4.5, 5.25, 6, 6.75 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "values":[ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ] }
[sub_resource type="Animation" id=4]
resource/name = "walk"
length = 1.25
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/keys = { "cont":false, "times":FloatArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1 ), "values":[ 0, 1, 2, 3, 4, 0 ] }
[sub_resource type="ColorRamp" id=5]
offsets = FloatArray( 0, 1 )
colors = ColorArray( 1, 0.884956, 0.823009, 1, 0.768627, 0.389381, 0, 0 )
[sub_resource type="SampleLibrary" id=6]
samples/explode = { "db":0.0, "pitch":1.0, "sample":ExtResource( 4 ) }
samples/hit = { "db":0.0, "pitch":1.0, "sample":ExtResource( 5 ) }
[node name="enemy" type="RigidBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, -1.08072, -2.16144 )
shapes/0/trigger = false
shapes/1/shape = SubResource( 1 )
shapes/1/transform = Matrix32( 1, 0, 0, 1, 6.48431, 3.24216 )
shapes/1/trigger = false
shapes/2/shape = SubResource( 1 )
shapes/2/transform = Matrix32( 1, 0, 0, 1, -12.495, 3.53415 )
shapes/2/trigger = false
collision/layers = 1
collision/mask = 1
mode = 2
mass = 1.0
friction = 0.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 4
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
script/script = ExtResource( 1 )
[node name="enabler" type="VisibilityEnabler2D" parent="."]
transform/pos = Vector2( 16.2569, 11.0034 )
transform/scale = Vector2( 23.5056, 10.8629 )
rect = Rect2( -10, -10, 20, 20 )
enabler/pause_animations = true
enabler/freeze_bodies = true
enabler/pause_particles = true
enabler/process_parent = false
enabler/fixed_process_parent = false
[node name="anim" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/explode = SubResource( 2 )
anims/idle = SubResource( 3 )
anims/walk = SubResource( 4 )
playback/active = true
playback/speed = 3.0
blend_times = [ ]
autoplay = ""
[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
hframes = 8
frame = 4
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( -1.08072, -2.16144 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="CollisionShape2D 2" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 6.48431, 3.24216 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="CollisionShape2D 3" type="CollisionShape2D" parent="."]
transform/pos = Vector2( -12.495, 3.53415 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="raycast_left" type="RayCast2D" parent="."]
transform/pos = Vector2( -33.2868, -9.34363 )
enabled = true
cast_to = Vector2( 0, 45 )
layer_mask = 1
type_mask = 15
[node name="raycast_right" type="RayCast2D" parent="."]
transform/pos = Vector2( 29.1987, -9.34363 )
enabled = true
cast_to = Vector2( 0, 45 )
layer_mask = 1
type_mask = 15
[node name="Particles2D" type="Particles2D" parent="."]
visibility/self_opacity = 0.121212
visibility/blend_mode = 1
config/amount = 32
config/lifetime = 0.5
config/emit_timeout = 0.5
config/emitting = false
config/explosiveness = 0.1
config/texture = ExtResource( 3 )
params/direction = 0.0
params/spread = 180.0
params/linear_velocity = 90.0
params/spin_velocity = 2.0
params/orbit_velocity = 0.0
params/gravity_direction = 0.0
params/gravity_strength = 9.8
params/radial_accel = 0.0
params/tangential_accel = 0.0
params/damping = 0.0
params/initial_angle = 0.0
params/initial_size = 2.0
params/final_size = 3.0
params/hue_variation = 0.0
params/anim_speed_scale = 1.0
params/anim_initial_pos = 0.0
randomness/spin_velocity = 1.0
color/color_ramp = SubResource( 5 )
[node name="sound" type="SamplePlayer2D" parent="."]
params/volume_db = 0.0
params/pitch_scale = 1.0
params/attenuation/min_distance = 1.0
params/attenuation/max_distance = 2048.0
params/attenuation/distance_exp = 1.0
config/polyphony = 3
config/samples = SubResource( 6 )
config/pitch_random = 0.0

View File

@@ -0,0 +1,47 @@
[application]
name="Split Screen Platformer"
main_scene="res://split_stage.tscn"
icon="res://icon.png"
name_es="Plataformero"
target_fps="60"
[display]
width=800
height=480
stretch_mode="2d"
stretch_aspect="keep_height"
[image_loader]
repeat=false
[input]
move_left1=[key(A), jbutton(1, 14)]
move_right1=[key(D), jbutton(1, 15)]
jump1=[key(W), jbutton(1, 0)]
shoot1=[key(Space), jbutton(1, 2)]
spawn1=[key(F2), jbutton(1, 11)]
move_left0=[key(Left), jbutton(0, 14)]
move_right0=[key(Right), jbutton(0, 15)]
jump0=[key(Up), jbutton(0, 0)]
shoot0=[key(Return), jbutton(0, 2)]
spawn0=[key(F1), jbutton(0, 11)]
[physics_2d]
default_gravity=700
[rasterizer]
use_pixel_snap=true
[render]
mipmap_policy=1
[texture_import]
filter=false

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

View File

@@ -0,0 +1,20 @@
extends Node2D
# Member variables
export var motion = Vector2()
export var cycle = 1.0
var accum = 0.0
func _fixed_process(delta):
accum += delta*(1.0/cycle)*PI*2.0
accum = fmod(accum, PI*2.0)
var d = sin(accum)
var xf = Matrix32()
xf[2]= motion*d
get_node("platform").set_transform(xf)
func _ready():
set_fixed_process(true)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,52 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://moving_platform.gd" type="Script" id=1]
[ext_resource path="res://moving_platform.png" type="Texture" id=2]
[sub_resource type="ConvexPolygonShape2D" id=1]
custom_solver_bias = 0.0
points = Vector2Array( -88, 24, -88, -24, 88, -24, 88, 24 )
[node name="moving_platform" type="Node2D"]
script/script = ExtResource( 1 )
motion = Vector2( 0, 0 )
cycle = 1.0
[node name="platform" type="RigidBody2D" parent="."]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 3
mass = 1.0
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
[node name="Sprite" type="Sprite" parent="platform"]
texture = ExtResource( 2 )
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform"]
build_mode = 0
polygon = Vector2Array( -88, -24, 88, -24, 88, 24, -88, 24 )
shape_range = Vector2( -1, -1 )
trigger = false

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1,36 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://one_way_platform.png" type="Texture" id=1]
[sub_resource type="RectangleShape2D" id=1]
custom_solver_bias = 0.0
extents = Vector2( 100, 10 )
[node name="one_way_platform" type="StaticBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 1.46304, -13.1672 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
one_way_collision/direction = Vector2( 0, 1 )
one_way_collision/max_depth = 20.0
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 1.46304, -13.1672 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,101 @@
[gd_scene load_steps=7 format=1]
[ext_resource path="res://scroll_bg_sky.png" type="Texture" id=1]
[ext_resource path="res://scroll_bg_cloud_1.png" type="Texture" id=2]
[ext_resource path="res://scroll_bg_cloud_2.png" type="Texture" id=3]
[ext_resource path="res://scroll_bg_cloud_3.png" type="Texture" id=4]
[ext_resource path="res://scroll_bg_fg_2.png" type="Texture" id=5]
[ext_resource path="res://scroll_bg_fg_1.png" type="Texture" id=6]
[node name="parallax_bg" type="ParallaxBackground"]
layer = -1
offset = Vector2( 0, 0 )
rotation = 0.0
scale = Vector2( 1, 1 )
scroll/offset = Vector2( 0, 0 )
scroll/base_offset = Vector2( 0, 0 )
scroll/base_scale = Vector2( 0.7, 0 )
scroll/limit_begin = Vector2( 0, 0 )
scroll/limit_end = Vector2( 0, 0 )
scroll/ignore_camera_zoom = false
[node name="sky" type="ParallaxLayer" parent="."]
motion/scale = Vector2( 1, 1 )
motion/mirroring = Vector2( 800, 0 )
[node name="Sprite" type="Sprite" parent="sky"]
transform/scale = Vector2( 32, 0.94 )
texture = ExtResource( 1 )
centered = false
[node name="clouds" type="ParallaxLayer" parent="."]
motion/scale = Vector2( 0.1, 1 )
motion/mirroring = Vector2( 800, 0 )
[node name="Sprite" type="Sprite" parent="clouds"]
transform/pos = Vector2( 28, 127 )
texture = ExtResource( 2 )
centered = false
[node name="Sprite 2" type="Sprite" parent="clouds"]
transform/pos = Vector2( 404, 24 )
texture = ExtResource( 2 )
centered = false
[node name="Sprite 3" type="Sprite" parent="clouds"]
transform/pos = Vector2( 154, 46 )
texture = ExtResource( 3 )
centered = false
[node name="Sprite 4" type="Sprite" parent="clouds"]
transform/pos = Vector2( 525, 130 )
texture = ExtResource( 3 )
centered = false
[node name="Sprite 5" type="Sprite" parent="clouds"]
transform/pos = Vector2( 255, 158 )
texture = ExtResource( 4 )
centered = false
[node name="Sprite 6" type="Sprite" parent="clouds"]
transform/pos = Vector2( 674, 70 )
texture = ExtResource( 4 )
centered = false
[node name="mount_ 2" type="ParallaxLayer" parent="."]
motion/scale = Vector2( 0.2, 1 )
motion/mirroring = Vector2( 800, 0 )
[node name="Sprite" type="Sprite" parent="mount_ 2"]
transform/pos = Vector2( 0, 225 )
texture = ExtResource( 5 )
centered = false
region = true
region_rect = Rect2( 0, 0, 800, 256 )
[node name="mount_1" type="ParallaxLayer" parent="."]
motion/scale = Vector2( 0.4, 1 )
motion/mirroring = Vector2( 800, 0 )
[node name="Sprite" type="Sprite" parent="mount_1"]
transform/pos = Vector2( 0, 225 )
texture = ExtResource( 6 )
centered = false
region = true
region_rect = Rect2( 0, 0, 800, 256 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

View File

@@ -0,0 +1,233 @@
extends RigidBody2D
# Character Demo, written by Juan Linietsky.
#
# Implementation of a 2D Character controller.
# This implementation uses the physics engine for
# controlling a character, in a very similar way
# than a 3D character controller would be implemented.
#
# Using the physics engine for this has the main
# advantages:
# -Easy to write.
# -Interaction with other physics-based objects is free
# -Only have to deal with the object linear velocity, not position
# -All collision/area framework available
#
# But also has the following disadvantages:
#
# -Objects may bounce a little bit sometimes
# -Going up ramps sends the chracter flying up, small hack is needed.
# -A ray collider is needed to avoid sliding down on ramps and
# undesiderd bumps, small steps and rare numerical precision errors.
# (another alternative may be to turn on friction when the character is not moving).
# -Friction cant be used, so floor velocity must be considered
# for moving platforms.
# Member variables
var anim = ""
var siding_left = false
var jumping = false
var stopping_jump = false
var shooting = false
var WALK_ACCEL = 800.0
var WALK_DEACCEL = 800.0
var WALK_MAX_VELOCITY = 200.0
var AIR_ACCEL = 200.0
var AIR_DEACCEL = 200.0
var JUMP_VELOCITY = 460
var STOP_JUMP_FORCE = 900.0
var MAX_FLOOR_AIRBORNE_TIME = 0.15
var airborne_time = 1e20
var shoot_time = 1e20
var MAX_SHOOT_POSE_TIME = 0.3
var bullet = preload("res://bullet.tscn")
var floor_h_velocity = 0.0
var enemy
export(int, "Player 1", "Player 2") var index = 0
func _integrate_forces(s):
var lv = s.get_linear_velocity()
var step = s.get_step()
var new_anim = anim
var new_siding_left = siding_left
# Get the controls
var move_left = Input.is_action_pressed("move_left" + str(index))
var move_right = Input.is_action_pressed("move_right" + str(index))
var jump = Input.is_action_pressed("jump" + str(index))
var shoot = Input.is_action_pressed("shoot" + str(index))
var spawn = Input.is_action_pressed("spawn" + str(index))
if spawn:
var e = enemy.instance()
var p = get_pos()
p.y = p.y - 100
e.set_pos(p)
get_parent().add_child(e)
# Deapply prev floor velocity
lv.x -= floor_h_velocity
floor_h_velocity = 0.0
# Find the floor (a contact with upwards facing collision normal)
var found_floor = false
var floor_index = -1
for x in range(s.get_contact_count()):
var ci = s.get_contact_local_normal(x)
if (ci.dot(Vector2(0, -1)) > 0.6):
found_floor = true
floor_index = x
# A good idea when impementing characters of all kinds,
# compensates for physics imprecission, as well as human reaction delay.
if (shoot and not shooting):
shoot_time = 0
var bi = bullet.instance()
var ss
if (siding_left):
ss = -1.0
else:
ss = 1.0
var pos = get_pos() + get_node("bullet_shoot").get_pos()*Vector2(ss, 1.0)
bi.set_pos(pos)
get_parent().add_child(bi)
bi.set_linear_velocity(Vector2(800.0*ss, -80))
get_node("sprite/smoke").set_emitting(true)
get_node("sound").play("shoot")
PS2D.body_add_collision_exception(bi.get_rid(), get_rid()) # Make bullet and this not collide
else:
shoot_time += step
if (found_floor):
airborne_time = 0.0
else:
airborne_time += step # Time it spent in the air
var on_floor = airborne_time < MAX_FLOOR_AIRBORNE_TIME
# Process jump
if (jumping):
if (lv.y > 0):
# Set off the jumping flag if going down
jumping = false
elif (not jump):
stopping_jump = true
if (stopping_jump):
lv.y += STOP_JUMP_FORCE*step
if (on_floor):
# Process logic when character is on floor
if (move_left and not move_right):
if (lv.x > -WALK_MAX_VELOCITY):
lv.x -= WALK_ACCEL*step
elif (move_right and not move_left):
if (lv.x < WALK_MAX_VELOCITY):
lv.x += WALK_ACCEL*step
else:
var xv = abs(lv.x)
xv -= WALK_DEACCEL*step
if (xv < 0):
xv = 0
lv.x = sign(lv.x)*xv
# Check jump
if (not jumping and jump):
lv.y = -JUMP_VELOCITY
jumping = true
stopping_jump = false
get_node("sound").play("jump")
# Check siding
if (lv.x < 0 and move_left):
new_siding_left = true
elif (lv.x > 0 and move_right):
new_siding_left = false
if (jumping):
new_anim = "jumping"
elif (abs(lv.x) < 0.1):
if (shoot_time < MAX_SHOOT_POSE_TIME):
new_anim = "idle_weapon"
else:
new_anim = "idle"
else:
if (shoot_time < MAX_SHOOT_POSE_TIME):
new_anim = "run_weapon"
else:
new_anim = "run"
else:
# Process logic when the character is in the air
if (move_left and not move_right):
if (lv.x > -WALK_MAX_VELOCITY):
lv.x -= AIR_ACCEL*step
elif (move_right and not move_left):
if (lv.x < WALK_MAX_VELOCITY):
lv.x += AIR_ACCEL*step
else:
var xv = abs(lv.x)
xv -= AIR_DEACCEL*step
if (xv < 0):
xv = 0
lv.x = sign(lv.x)*xv
if (lv.y < 0):
if (shoot_time < MAX_SHOOT_POSE_TIME):
new_anim = "jumping_weapon"
else:
new_anim = "jumping"
else:
if (shoot_time < MAX_SHOOT_POSE_TIME):
new_anim = "falling_weapon"
else:
new_anim = "falling"
# Update siding
if (new_siding_left != siding_left):
if (new_siding_left):
get_node("sprite").set_scale(Vector2(-1, 1))
else:
get_node("sprite").set_scale(Vector2(1, 1))
siding_left = new_siding_left
# Change animation
if (new_anim != anim):
anim = new_anim
get_node("anim").play(anim)
shooting = shoot
# Apply floor velocity
if (found_floor):
floor_h_velocity = s.get_contact_collider_velocity_at_pos(floor_index).x
lv.x += floor_h_velocity
# Finally, apply gravity and set back the linear velocity
lv += s.get_total_gravity()*step
s.set_linear_velocity(lv)
func _ready():
enemy = ResourceLoader.load("res://enemy.tscn")
# if !Globals.has_singleton("Facebook"):
# return
# var Facebook = Globals.get_singleton("Facebook")
# var link = Globals.get("facebook/link")
# var icon = Globals.get("facebook/icon")
# var msg = "I just sneezed on your wall! Beat my score and Stop the Running nose!"
# var title = "I just sneezed on your wall!"
# Facebook.post("feed", msg, title, link, icon)

View File

@@ -0,0 +1,341 @@
[gd_scene load_steps=25 format=1]
[ext_resource path="res://player.gd" type="Script" id=1]
[ext_resource path="res://robot_demo.png" type="Texture" id=2]
[ext_resource path="res://bullet.png" type="Texture" id=3]
[ext_resource path="res://sound_coin.wav" type="Sample" id=4]
[ext_resource path="res://sound_jump.wav" type="Sample" id=5]
[ext_resource path="res://sound_shoot.wav" type="Sample" id=6]
[ext_resource path="res://osb_left.png" type="Texture" id=7]
[ext_resource path="res://osb_right.png" type="Texture" id=8]
[ext_resource path="res://osb_jump.png" type="Texture" id=9]
[ext_resource path="res://osb_fire.png" type="Texture" id=10]
[sub_resource type="RayShape2D" id=1]
custom_solver_bias = 0.5
length = 20.0
[sub_resource type="ConvexPolygonShape2D" id=2]
custom_solver_bias = 0.0
points = Vector2Array( -19.902, -24.8691, 19.3625, -24.6056, -0.138023, 16.5036 )
[sub_resource type="ColorRamp" id=3]
offsets = FloatArray( 0, 1 )
colors = ColorArray( 1, 1, 1, 1, 0, 0, 0, 0.0442478 )
[sub_resource type="Animation" id=4]
resource/name = "crouch"
length = 0.01
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "update":1, "values":[ 22 ] }
[sub_resource type="Animation" id=5]
resource/name = "falling"
length = 0.01
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "update":1, "values":[ 21 ] }
[sub_resource type="Animation" id=6]
resource/name = "falling_weapon"
length = 0.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "update":1, "values":[ 26 ] }
[sub_resource type="Animation" id=7]
length = 7.0
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0, 1.25, 1.5, 2, 4.5, 4.75, 5, 5.25 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1, 1, 1 ), "update":1, "values":[ 16, 17, 18, 16, 19, 20, 19, 16 ] }
[sub_resource type="Animation" id=8]
length = 0.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "update":1, "values":[ 25 ] }
[sub_resource type="Animation" id=9]
length = 0.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0, 0.25, 0.5 ), "transitions":FloatArray( 1, 1, 1 ), "update":1, "values":[ 23, 24, 23 ] }
[sub_resource type="Animation" id=10]
length = 0.5
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0 ), "transitions":FloatArray( 1 ), "update":1, "values":[ 26 ] }
[sub_resource type="Animation" id=11]
length = 1.25
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1 ), "update":1, "values":[ 0, 1, 2, 3, 4, 0 ] }
[sub_resource type="Animation" id=12]
length = 1.25
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1 ), "update":1, "values":[ 5, 6, 7, 8, 9, 5 ] }
[sub_resource type="Animation" id=13]
length = 1.25
loop = true
step = 0.25
tracks/0/type = "value"
tracks/0/path = NodePath("sprite:frame")
tracks/0/interp = 1
tracks/0/imported = false
tracks/0/keys = { "times":FloatArray( 0, 0.25, 0.5, 0.75, 1, 1.25 ), "transitions":FloatArray( 1, 1, 1, 1, 1, 1 ), "update":1, "values":[ 10, 11, 12, 13, 14, 5 ] }
[sub_resource type="SampleLibrary" id=14]
samples/coin = { "db":0.0, "pitch":1.0, "sample":ExtResource( 4 ) }
samples/jump = { "db":0.0, "pitch":1.0, "sample":ExtResource( 5 ) }
samples/shoot = { "db":0.0, "pitch":1.0, "sample":ExtResource( 6 ) }
[node name="player" type="RigidBody2D"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1.76469, 0.291992, -12.1587 )
shapes/0/trigger = false
shapes/1/shape = SubResource( 2 )
shapes/1/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/1/trigger = false
collision/layers = 1
collision/mask = 1
mode = 2
mass = 3.0
friction = 0.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = true
continuous_cd = 0
contacts_reported = 3
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
script/script = ExtResource( 1 )
index = 0
[node name="sprite" type="Sprite" parent="."]
texture = ExtResource( 2 )
vframes = 2
hframes = 16
[node name="smoke" type="Particles2D" parent="sprite"]
visibility/self_opacity = 0.363636
visibility/blend_mode = 1
transform/pos = Vector2( 20.7312, 3.21187 )
transform/rot = 83.4504
config/amount = 4
config/lifetime = 0.3
config/emit_timeout = 0.3
config/emitting = false
config/local_space = false
config/explosiveness = 0.1
config/texture = ExtResource( 3 )
params/direction = 0.0
params/spread = 180.0
params/linear_velocity = 20.0
params/spin_velocity = 1.0
params/orbit_velocity = 0.0
params/gravity_direction = 0.0
params/gravity_strength = 9.8
params/radial_accel = 0.0
params/tangential_accel = 0.0
params/damping = 0.0
params/initial_angle = 0.0
params/initial_size = 2.0
params/final_size = 2.0
params/hue_variation = 0.0
params/anim_speed_scale = 1.0
params/anim_initial_pos = 0.0
randomness/spin_velocity = 2.0
color/color_ramp = SubResource( 3 )
[node name="anim" type="AnimationPlayer" parent="."]
playback/process_mode = 1
playback/default_blend_time = 0.0
root/root = NodePath("..")
anims/crouch = SubResource( 4 )
anims/falling = SubResource( 5 )
anims/falling_weapon = SubResource( 6 )
anims/idle = SubResource( 7 )
anims/idle_weapon = SubResource( 8 )
anims/jumping = SubResource( 9 )
anims/jumping_weapon = SubResource( 10 )
anims/run = SubResource( 11 )
anims/run_weapon = SubResource( 12 )
anims/standing_weapon_ready = SubResource( 13 )
playback/active = true
playback/speed = 2.0
blend_times = [ ]
autoplay = ""
[node name="camera" type="Camera2D" parent="."]
anchor_mode = 1
rotating = false
current = true
zoom = Vector2( 1, 1 )
limit/left = 0
limit/top = 0
limit/right = 10000000
limit/bottom = 10000000
drag_margin/h_enabled = true
drag_margin/v_enabled = true
smoothing/enable = false
smoothing/speed = 5.0
drag_margin/left = 0.2
drag_margin/top = 0.2
drag_margin/right = 0.2
drag_margin/bottom = 0.2
[node name="bullet_shoot" type="Position2D" parent="."]
transform/pos = Vector2( 31.2428, 4.08784 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
transform/pos = Vector2( 0.291992, -12.1587 )
transform/scale = Vector2( 1, 1.76469 )
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="sound" type="SamplePlayer" parent="."]
config/polyphony = 1
config/samples = SubResource( 14 )
default/volume_db = 0.0
default/pitch_scale = 1.0
default/pan = 0.0
default/depth = 0.0
default/height = 0.0
default/filter/type = 0
default/filter/cutoff = 0.0
default/filter/resonance = 0.0
default/filter/gain = 0.0
default/reverb_room = 2
default/reverb_send = 0.0
default/chorus_send = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
build_mode = 0
polygon = Vector2Array( -0.138023, 16.5036, -19.902, -24.8691, 19.3625, -24.6056 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="ui" type="CanvasLayer" parent="."]
layer = 0
offset = Vector2( 0, 0 )
rotation = 0.0
scale = Vector2( 1, 1 )
[node name="left" type="TouchScreenButton" parent="ui"]
transform/pos = Vector2( 27.7593, 360.87 )
transform/scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 7 )
pressed = null
bitmask = null
passby_press = true
action = "move_left"
visibility_mode = 1
[node name="right" type="TouchScreenButton" parent="ui"]
transform/pos = Vector2( 121.542, 361.415 )
transform/scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 8 )
pressed = null
bitmask = null
passby_press = true
action = "move_right"
visibility_mode = 1
[node name="jump" type="TouchScreenButton" parent="ui"]
transform/pos = Vector2( 666.224, 359.02 )
transform/scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 9 )
pressed = null
bitmask = null
passby_press = false
action = "jump"
visibility_mode = 1
[node name="fire" type="TouchScreenButton" parent="ui"]
transform/pos = Vector2( 668.073, 262.788 )
transform/scale = Vector2( 1.49157, 1.46265 )
normal = ExtResource( 10 )
pressed = null
bitmask = null
passby_press = false
action = "shoot"
visibility_mode = 1

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,60 @@
[gd_scene load_steps=4 format=1]
[ext_resource path="res://plank.png" type="Texture" id=1]
[ext_resource path="res://plankpin.png" type="Texture" id=2]
[sub_resource type="RectangleShape2D" id=1]
custom_solver_bias = 0.0
extents = Vector2( 128, 8 )
[node name="seesaw" type="Node2D"]
[node name="plank" type="RigidBody2D" parent="."]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
mode = 0
mass = 5.10204
friction = 1.0
bounce = 0.0
gravity_scale = 1.0
custom_integrator = false
continuous_cd = 0
contacts_reported = 0
contact_monitor = false
sleeping = false
can_sleep = true
velocity/linear = Vector2( 0, 0 )
velocity/angular = 0.0
damp_override/linear = -1.0
damp_override/angular = -1.0
[node name="sprite" type="Sprite" parent="plank"]
texture = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="plank"]
shape = SubResource( 1 )
trigger = false
_update_shape_index = -1
[node name="pin" type="PinJoint2D" parent="."]
node_a = NodePath("../plank")
node_b = NodePath("")
bias/bias = 0.0
collision/exclude_nodes = true
softness = 0.0
[node name="Sprite" type="Sprite" parent="."]
transform/pos = Vector2( -0.290825, 20.2425 )
texture = ExtResource( 2 )

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,15 @@
extends Control
func _ready():
#make bottom viewport have the same world2D as the top viewport, so both show the same
get_node("bottom/viewport").set_world_2d( get_node("top/viewport").get_world_2d() )
#make player2 camera control the offset of the bottom viewport
get_node("top/viewport/stage/player2/camera").set_custom_viewport( get_node("bottom/viewport") )
#
var parallax_copy = get_node("top/viewport/stage/parallax_bg").duplicate()
parallax_copy.set_custom_viewport( get_node("bottom/viewport") )
get_node("top/viewport/stage").add_child(parallax_copy)
#simple and alternatively, copy them to the other viewport, but they must be erased when level is unloaded
#get_node("bottom/viewport").add_child( get_node("top/viewport/stage/parallax_bg").duplicate() )
pass

View File

@@ -0,0 +1,83 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://split_stage.gd" type="Script" id=1]
[ext_resource path="res://stage.tscn" type="PackedScene" id=2]
[node name="main_control" type="Control"]
anchor/right = 1
anchor/bottom = 1
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 0.0
margin/bottom = 0.0
script/script = ExtResource( 1 )
[node name="top" type="Control" parent="."]
anchor/right = 1
anchor/bottom = 3
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 0.0
margin/bottom = 0.0
[node name="viewport" type="Viewport" parent="top"]
rect = Rect2( 0, 0, 800, 240 )
own_world = false
world = null
transparent_bg = false
render_target/enabled = false
render_target/v_flip = false
render_target/clear_on_new_frame = true
render_target/filter = false
render_target/gen_mipmaps = false
render_target/update_mode = 2
audio_listener/enable_2d = false
audio_listener/enable_3d = false
physics/object_picking = false
gui/disable_input = false
[node name="stage" parent="top/viewport" instance=ExtResource( 2 )]
[node name="bottom" type="Control" parent="."]
anchor/top = 3
anchor/right = 1
anchor/bottom = 1
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 0.0
margin/bottom = 0.0
[node name="viewport" type="Viewport" parent="bottom"]
rect = Rect2( 0, 0, 800, 240 )
own_world = false
world = null
transparent_bg = false
render_target/enabled = false
render_target/v_flip = false
render_target/clear_on_new_frame = true
render_target/filter = false
render_target/gen_mipmaps = false
render_target/update_mode = 2
audio_listener/enable_2d = false
audio_listener/enable_3d = false
physics/object_picking = false
gui/disable_input = false

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -0,0 +1 @@
filter=false

View File

@@ -0,0 +1,195 @@
[gd_resource type="TileSet" load_steps=14 format=1]
[ext_resource path="res://tiles_demo.png" type="Texture" id=1]
[sub_resource type="ConvexPolygonShape2D" id=1]
custom_solver_bias = 0.0
points = Vector2Array( -32, -24, 32, -24, 32, 32, -32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=2]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -24, 24, -24, 24, 32 )
[sub_resource type="ConvexPolygonShape2D" id=3]
custom_solver_bias = 0.0
points = Vector2Array( -32, -32, 32, -32, 32, 32, -32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=4]
custom_solver_bias = 0.0
points = Vector2Array( -32, -56, 32, 8, 32, 64, -32, 64 )
[sub_resource type="ConvexPolygonShape2D" id=5]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -32, 24, -32, 24, 32 )
[sub_resource type="ConvexPolygonShape2D" id=6]
custom_solver_bias = 0.0
points = Vector2Array( -32, -24, 32, -24, 32, 24, -32, 24 )
[sub_resource type="ConvexPolygonShape2D" id=7]
custom_solver_bias = 0.0
points = Vector2Array( -32, -24, 24, -24, 24, 24, -32, 24 )
[sub_resource type="ConvexPolygonShape2D" id=8]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -32, 24, -32, 24, 32 )
[sub_resource type="ConvexPolygonShape2D" id=9]
custom_solver_bias = 0.0
points = Vector2Array( -64, 32, -64, -32, -8, -32, -8, 32 )
[sub_resource type="ConvexPolygonShape2D" id=10]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -32, 24, -32, 32, -24, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=11]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -24, 32, -24, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=12]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -24, 32, -24, 32, 32 )
[resource]
0/name = "floor"
0/texture = ExtResource( 1 )
0/tex_offset = Vector2( 0, 0 )
0/region = Rect2( 0, 0, 64, 64 )
0/occluder_offset = Vector2( 32, 32 )
0/navigation_offset = Vector2( 32, 32 )
0/shape_offset = Vector2( 32, 32 )
0/shapes = [ SubResource( 1 ) ]
1/name = "edge"
1/texture = ExtResource( 1 )
1/tex_offset = Vector2( 0, 0 )
1/region = Rect2( 64, 0, 64, 64 )
1/occluder_offset = Vector2( 32, 32 )
1/navigation_offset = Vector2( 32, 32 )
1/shape_offset = Vector2( 32, 32 )
1/shapes = [ SubResource( 2 ) ]
2/name = "wall"
2/texture = ExtResource( 1 )
2/tex_offset = Vector2( 0, 0 )
2/region = Rect2( 64, 64, 64, 64 )
2/occluder_offset = Vector2( 32, 32 )
2/navigation_offset = Vector2( 32, 32 )
2/shape_offset = Vector2( 32, 32 )
2/shapes = [ SubResource( 8 ) ]
3/name = "wall_deco"
3/texture = ExtResource( 1 )
3/tex_offset = Vector2( 0, 0 )
3/region = Rect2( 320, 128, 128, 64 )
3/occluder_offset = Vector2( 64, 32 )
3/navigation_offset = Vector2( 64, 32 )
3/shape_offset = Vector2( 64, 32 )
3/shapes = [ SubResource( 9 ) ]
4/name = "corner"
4/texture = ExtResource( 1 )
4/tex_offset = Vector2( 0, 0 )
4/region = Rect2( 64, 128, 64, 64 )
4/occluder_offset = Vector2( 32, 32 )
4/navigation_offset = Vector2( 32, 32 )
4/shape_offset = Vector2( 32, 32 )
4/shapes = [ SubResource( 10 ) ]
5/name = "flowers"
5/texture = ExtResource( 1 )
5/tex_offset = Vector2( 0, 0 )
5/region = Rect2( 192, 192, 64, 64 )
5/occluder_offset = Vector2( 32, 32 )
5/navigation_offset = Vector2( 32, 32 )
5/shape_offset = Vector2( 32, 32 )
5/shapes = [ SubResource( 11 ) ]
6/name = "tree_base"
6/texture = ExtResource( 1 )
6/tex_offset = Vector2( 0, 0 )
6/region = Rect2( 256, 192, 64, 64 )
6/occluder_offset = Vector2( 32, 32 )
6/navigation_offset = Vector2( 32, 32 )
6/shape_offset = Vector2( 32, 32 )
6/shapes = [ SubResource( 12 ) ]
7/name = "tree_mid"
7/texture = ExtResource( 1 )
7/tex_offset = Vector2( 0, 0 )
7/region = Rect2( 256, 128, 64, 64 )
7/occluder_offset = Vector2( 32, 32 )
7/navigation_offset = Vector2( 32, 32 )
7/shape_offset = Vector2( 0, 0 )
7/shapes = [ ]
8/name = "tree_mid 2"
8/texture = ExtResource( 1 )
8/tex_offset = Vector2( 0, 0 )
8/region = Rect2( 256, 64, 64, 64 )
8/occluder_offset = Vector2( 32, 32 )
8/navigation_offset = Vector2( 32, 32 )
8/shape_offset = Vector2( 0, 0 )
8/shapes = [ ]
9/name = "tree_top"
9/texture = ExtResource( 1 )
9/tex_offset = Vector2( 0, 0 )
9/region = Rect2( 256, 0, 64, 64 )
9/occluder_offset = Vector2( 32, 32 )
9/navigation_offset = Vector2( 32, 32 )
9/shape_offset = Vector2( 0, 0 )
9/shapes = [ ]
10/name = "solid"
10/texture = ExtResource( 1 )
10/tex_offset = Vector2( 0, 0 )
10/region = Rect2( 0, 64, 64, 64 )
10/occluder_offset = Vector2( 32, 32 )
10/navigation_offset = Vector2( 32, 32 )
10/shape_offset = Vector2( 0, 0 )
10/shapes = [ ]
11/name = "ceiling"
11/texture = ExtResource( 1 )
11/tex_offset = Vector2( 0, 0 )
11/region = Rect2( 384, 64, 64, 64 )
11/occluder_offset = Vector2( 32, 32 )
11/navigation_offset = Vector2( 32, 32 )
11/shape_offset = Vector2( 32, 32 )
11/shapes = [ SubResource( 3 ) ]
12/name = "ramp"
12/texture = ExtResource( 1 )
12/tex_offset = Vector2( 0, 0 )
12/region = Rect2( 128, 128, 64, 128 )
12/occluder_offset = Vector2( 32, 64 )
12/navigation_offset = Vector2( 32, 64 )
12/shape_offset = Vector2( 32, 64 )
12/shapes = [ SubResource( 4 ) ]
13/name = "ceiling2wall"
13/texture = ExtResource( 1 )
13/tex_offset = Vector2( 0, 0 )
13/region = Rect2( 448, 64, 64, 64 )
13/occluder_offset = Vector2( 32, 32 )
13/navigation_offset = Vector2( 32, 32 )
13/shape_offset = Vector2( 32, 32 )
13/shapes = [ SubResource( 5 ) ]
14/name = "platform_floor"
14/texture = ExtResource( 1 )
14/tex_offset = Vector2( 0, 0 )
14/region = Rect2( 128, 0, 64, 64 )
14/occluder_offset = Vector2( 32, 32 )
14/navigation_offset = Vector2( 32, 32 )
14/shape_offset = Vector2( 32, 32 )
14/shapes = [ SubResource( 6 ) ]
15/name = "platform_edge"
15/texture = ExtResource( 1 )
15/tex_offset = Vector2( 0, 0 )
15/region = Rect2( 192, 0, 64, 64 )
15/occluder_offset = Vector2( 32, 32 )
15/navigation_offset = Vector2( 32, 32 )
15/shape_offset = Vector2( 32, 32 )
15/shapes = [ SubResource( 7 ) ]

View File

@@ -0,0 +1,432 @@
[gd_scene load_steps=14 format=1]
[ext_resource path="res://tiles_demo.png" type="Texture" id=1]
[sub_resource type="ConvexPolygonShape2D" id=1]
custom_solver_bias = 0.0
points = Vector2Array( -32, -24, 32, -24, 32, 32, -32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=2]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -24, 24, -24, 24, 32 )
[sub_resource type="ConvexPolygonShape2D" id=3]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -32, 24, -32, 24, 32 )
[sub_resource type="ConvexPolygonShape2D" id=4]
custom_solver_bias = 0.0
points = Vector2Array( -64, 32, -64, -32, -8, -32, -8, 32 )
[sub_resource type="ConvexPolygonShape2D" id=5]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -32, 24, -32, 32, -24, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=6]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -24, 32, -24, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=7]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -24, 32, -24, 32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=8]
custom_solver_bias = 0.0
points = Vector2Array( -32, -32, 32, -32, 32, 32, -32, 32 )
[sub_resource type="ConvexPolygonShape2D" id=9]
custom_solver_bias = 0.0
points = Vector2Array( -32, -56, 32, 8, 32, 64, -32, 64 )
[sub_resource type="ConvexPolygonShape2D" id=10]
custom_solver_bias = 0.0
points = Vector2Array( -32, 32, -32, -32, 24, -32, 24, 32 )
[sub_resource type="ConvexPolygonShape2D" id=11]
custom_solver_bias = 0.0
points = Vector2Array( -32, -24, 32, -24, 32, 24, -32, 24 )
[sub_resource type="ConvexPolygonShape2D" id=12]
custom_solver_bias = 0.0
points = Vector2Array( -32, -24, 24, -24, 24, 24, -32, 24 )
[node name="Node" type="Node"]
[node name="floor" type="Sprite" parent="."]
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 0, 0, 64, 64 )
[node name="collision" type="StaticBody2D" parent="floor"]
input/pickable = false
shapes/0/shape = SubResource( 1 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="floor/collision"]
build_mode = 0
polygon = Vector2Array( 32, -24, 32, 32, -32, 32, -32, -24 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="edge" type="Sprite" parent="."]
transform/pos = Vector2( 64, 0 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 64, 0, 64, 64 )
[node name="collision" type="StaticBody2D" parent="edge"]
input/pickable = false
shapes/0/shape = SubResource( 2 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="edge/collision"]
build_mode = 0
polygon = Vector2Array( -32, -24, 24, -24, 24, 32, -32, 32 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="wall" type="Sprite" parent="."]
transform/pos = Vector2( 64, 64 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 64, 64, 64, 64 )
[node name="collision" type="StaticBody2D" parent="wall"]
input/pickable = false
shapes/0/shape = SubResource( 3 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="wall/collision"]
build_mode = 0
polygon = Vector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="wall_deco" type="Sprite" parent="."]
transform/pos = Vector2( 96, 128 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 320, 128, 128, 64 )
[node name="collision" type="StaticBody2D" parent="wall_deco"]
input/pickable = false
shapes/0/shape = SubResource( 4 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="wall_deco/collision"]
build_mode = 0
polygon = Vector2Array( -64, -32, -8, -32, -8, 32, -64, 32 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="corner" type="Sprite" parent="."]
transform/pos = Vector2( 64, 192 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 64, 128, 64, 64 )
[node name="collision" type="StaticBody2D" parent="corner"]
input/pickable = false
shapes/0/shape = SubResource( 5 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="corner/collision"]
build_mode = 0
polygon = Vector2Array( -32, -32, 24, -32, 32, -24, 32, 32, -32, 32 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="flowers" type="Sprite" parent="."]
transform/pos = Vector2( 128, 192 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 192, 192, 64, 64 )
[node name="collision" type="StaticBody2D" parent="flowers"]
input/pickable = false
shapes/0/shape = SubResource( 6 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="flowers/collision"]
build_mode = 0
polygon = Vector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="tree_base" type="Sprite" parent="."]
transform/pos = Vector2( 192, 192 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 256, 192, 64, 64 )
[node name="collision" type="StaticBody2D" parent="tree_base"]
input/pickable = false
shapes/0/shape = SubResource( 7 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="tree_base/collision"]
build_mode = 0
polygon = Vector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="tree_mid" type="Sprite" parent="."]
transform/pos = Vector2( 192, 128 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 256, 128, 64, 64 )
[node name="tree_mid 2" type="Sprite" parent="."]
transform/pos = Vector2( 192, 64 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 256, 64, 64, 64 )
[node name="tree_top" type="Sprite" parent="."]
transform/pos = Vector2( 192, 0 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 256, 0, 64, 64 )
[node name="solid" type="Sprite" parent="."]
transform/pos = Vector2( 0, 64 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 0, 64, 64, 64 )
[node name="ceiling" type="Sprite" parent="."]
transform/pos = Vector2( 0, 128 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 384, 64, 64, 64 )
[node name="collision" type="StaticBody2D" parent="ceiling"]
input/pickable = false
shapes/0/shape = SubResource( 8 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ceiling/collision"]
build_mode = 0
polygon = Vector2Array( 32, -32, 32, 32, -32, 32, -32, -32 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="ramp" type="Sprite" parent="."]
transform/pos = Vector2( 256, 224 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 128, 128, 64, 128 )
[node name="collision" type="StaticBody2D" parent="ramp"]
input/pickable = false
shapes/0/shape = SubResource( 9 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ramp/collision"]
build_mode = 0
polygon = Vector2Array( -32, -56, 32, 8, 32, 64, -32, 64 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="ceiling2wall" type="Sprite" parent="."]
transform/pos = Vector2( 0, 192 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 448, 64, 64, 64 )
[node name="collision" type="StaticBody2D" parent="ceiling2wall"]
input/pickable = false
shapes/0/shape = SubResource( 10 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ceiling2wall/collision"]
build_mode = 0
polygon = Vector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="platform_floor" type="Sprite" parent="."]
transform/pos = Vector2( 0, 256 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 128, 0, 64, 64 )
[node name="collision" type="StaticBody2D" parent="platform_floor"]
input/pickable = false
shapes/0/shape = SubResource( 11 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform_floor/collision"]
build_mode = 0
polygon = Vector2Array( 32, -24, 32, 24, -32, 24, -32, -24 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="platform_edge" type="Sprite" parent="."]
transform/pos = Vector2( 64, 256 )
texture = ExtResource( 1 )
region = true
region_rect = Rect2( 192, 0, 64, 64 )
[node name="collision" type="StaticBody2D" parent="platform_edge"]
input/pickable = false
shapes/0/shape = SubResource( 12 )
shapes/0/transform = Matrix32( 1, 0, 0, 1, 0, 0 )
shapes/0/trigger = false
collision/layers = 1
collision/mask = 1
constant_linear_velocity = Vector2( 0, 0 )
constant_angular_velocity = 0.0
friction = 1.0
bounce = 0.0
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform_edge/collision"]
build_mode = 0
polygon = Vector2Array( 24, -24, 24, 24, -32, 24, -32, -24 )
shape_range = Vector2( -1, -1 )
trigger = false
[node name="help" type="Label" parent="."]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
margin/left = 1.0
margin/top = 331.0
margin/right = 727.0
margin/bottom = 422.0
text = "This scene serves as a tool for editing the tileset.\nNodes (sprites) and their respective collisionsare edited here.\n\nTo create a tileset from this, a \"TileSet\" resoucre must be created. Use the helper in: Scene -> Convert To -> TileSet.\nThis will save a tileset. Saving over it will merge your changes.\n\nFinally, the saved tileset resource (tileset.tres in this case), can be opened to be used into a TileMap node for editing a tile map."
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1

Binary file not shown.

View File

@@ -9,3 +9,9 @@ func _on_coin_body_enter(body):
if (not taken and body extends preload("res://player.gd")):
get_node("anim").play("take")
taken = true
func _on_anim_finished():
if get_node("anim").get_current_animation() == "take":
queue_free()

Binary file not shown.

Binary file not shown.

View File

@@ -1,11 +1,13 @@
[application]
name="Tween Demo"
main_scene="res://main.scn"
main_scene="res://main.tscn"
icon="res://icon.png"
target_fps=60
[display]
height=800
width=1024
stretch_mode="2d"
stretch_aspect="keep_width"

BIN
misc/tween/godot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -25,11 +25,11 @@ func _ready():
var name = modes[index]
get_node("modes/" + name).connect("pressed", self, "on_modes_changed", [name])
get_node("color/color_from").set_color(Color(1, 0, 0, 1))
get_node("color/color_from").connect("color_changed", self, "on_color_changed")
get_node("colors/color_from/picker").set_color(Color(1, 0, 0, 1))
get_node("colors/color_from/picker").connect("color_changed", self, "on_color_changed")
get_node("color/color_to").set_color(Color(0, 1, 1, 1))
get_node("color/color_to").connect("color_changed", self, "on_color_changed")
get_node("colors/color_to/picker").set_color(Color(0, 1, 1, 1))
get_node("colors/color_to/picker").connect("color_changed", self, "on_color_changed")
get_node("trans/linear").set_pressed(true)
get_node("eases/in").set_pressed(true)
@@ -96,8 +96,8 @@ func reset_tween():
tween.interpolate_property(sprite, "transform/pos", Vector2(size.width, size.height), Vector2(0, 0), 2, state.trans, state.eases, 2)
if get_node("modes/color").is_pressed():
tween.interpolate_method(sprite, "set_modulate", get_node("color/color_from").get_color(), get_node("color/color_to").get_color(), 2, state.trans, state.eases)
tween.interpolate_property(sprite, "modulate", get_node("color/color_to").get_color(), get_node("color/color_from").get_color(), 2, state.trans, state.eases, 2)
tween.interpolate_method(sprite, "set_modulate", get_node("colors/color_from/picker").get_color(), get_node("colors/color_to/picker").get_color(), 2, state.trans, state.eases)
tween.interpolate_property(sprite, "modulate", get_node("colors/color_to/picker").get_color(), get_node("colors/color_from/picker").get_color(), 2, state.trans, state.eases, 2)
else:
sprite.set_modulate(Color(1,1,1,1))

Binary file not shown.

591
misc/tween/main.tscn Normal file
View File

@@ -0,0 +1,591 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://main.gd" type="Script" id=1]
[ext_resource path="res://godot.png" type="Texture" id=2]
[node name="main" type="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 800.0
margin/bottom = 600.0
script/script = ExtResource( 1 )
__meta__ = {
"__editor_plugin_screen__": "2D"
}
[node name="trans" type="VBoxContainer" parent="."]
editor/display_folded = true
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 56.0
margin/top = 288.0
margin/right = 129.0
margin/bottom = 614.0
alignment = 0
[node name="linear" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 73.0
margin/bottom = 20.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "linear"
flat = false
[node name="sine" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 24.0
margin/right = 73.0
margin/bottom = 44.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "sine"
flat = false
[node name="quint" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 48.0
margin/right = 73.0
margin/bottom = 68.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "quint"
flat = false
[node name="quart" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 72.0
margin/right = 73.0
margin/bottom = 92.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "quart"
flat = false
[node name="quad" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 96.0
margin/right = 73.0
margin/bottom = 116.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "quad"
flat = false
[node name="expo" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 120.0
margin/right = 73.0
margin/bottom = 140.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "expo"
flat = false
[node name="elastic" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 144.0
margin/right = 73.0
margin/bottom = 164.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "elastic"
flat = false
[node name="cubic" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 168.0
margin/right = 73.0
margin/bottom = 188.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "cubic"
flat = false
[node name="circ" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 192.0
margin/right = 73.0
margin/bottom = 212.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "circ"
flat = false
[node name="bounce" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 216.0
margin/right = 73.0
margin/bottom = 236.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "bounce"
flat = false
[node name="back" type="Button" parent="trans"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 240.0
margin/right = 73.0
margin/bottom = 260.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "back"
flat = false
[node name="eases" type="VBoxContainer" parent="."]
editor/display_folded = true
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 152.0
margin/top = 288.0
margin/right = 215.0
margin/bottom = 404.0
alignment = 0
[node name="in" type="Button" parent="eases"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 63.0
margin/bottom = 20.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "in"
flat = false
[node name="out" type="Button" parent="eases"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 24.0
margin/right = 63.0
margin/bottom = 44.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "out"
flat = false
[node name="in_out" type="Button" parent="eases"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 48.0
margin/right = 63.0
margin/bottom = 68.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "in_out"
flat = false
[node name="out_in" type="Button" parent="eases"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 72.0
margin/right = 63.0
margin/bottom = 92.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "out_in"
flat = false
[node name="modes" type="VBoxContainer" parent="."]
editor/display_folded = true
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 240.0
margin/top = 288.0
margin/right = 317.0
margin/bottom = 524.0
alignment = 0
[node name="move" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 77.0
margin/bottom = 20.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "move"
flat = false
[node name="color" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 24.0
margin/right = 77.0
margin/bottom = 44.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "color"
flat = false
[node name="scale" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 48.0
margin/right = 77.0
margin/bottom = 68.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "scale"
flat = false
[node name="rotate" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 72.0
margin/right = 77.0
margin/bottom = 92.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "rotate"
flat = false
[node name="callback" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 96.0
margin/right = 77.0
margin/bottom = 116.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "callback"
flat = false
[node name="follow" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 120.0
margin/right = 77.0
margin/bottom = 140.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "follow"
flat = false
[node name="repeat" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 144.0
margin/right = 77.0
margin/bottom = 164.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "repeat"
flat = false
[node name="pause" type="Button" parent="modes"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 168.0
margin/right = 77.0
margin/bottom = 188.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "pause"
flat = false
[node name="colors" type="HBoxContainer" parent="."]
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 384.0
margin/top = 288.0
margin/right = 424.0
margin/bottom = 328.0
custom_constants/separation = 40
alignment = 0
[node name="color_from" type="VBoxContainer" parent="colors"]
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 288.0
margin/bottom = 459.0
alignment = 0
[node name="label" type="Label" parent="colors/color_from"]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 0.0
margin/top = 0.0
margin/right = 288.0
margin/bottom = 14.0
text = "Color From:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="picker" type="ColorPicker" parent="colors/color_from"]
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 18.0
margin/right = 288.0
margin/bottom = 459.0
alignment = 0
[node name="color_to" type="VBoxContainer" parent="colors"]
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 328.0
margin/top = 0.0
margin/right = 616.0
margin/bottom = 459.0
alignment = 0
[node name="label" type="Label" parent="colors/color_to"]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 0.0
margin/top = 0.0
margin/right = 288.0
margin/bottom = 14.0
text = "Color To:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="picker" type="ColorPicker" parent="colors/color_to"]
focus/ignore_mouse = false
focus/stop_mouse = false
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 18.0
margin/right = 288.0
margin/bottom = 459.0
alignment = 0
[node name="tween" type="Tween" parent="."]
playback/process_mode = 1
playback/active = true
playback/repeat = true
playback/speed = 1.0
[node name="area" type="Panel" parent="tween"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 32.0
margin/top = 32.0
margin/right = 768.0
margin/bottom = 216.0
[node name="label" type="RichTextLabel" parent="tween/area"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 176.0
margin/top = 24.0
margin/right = 552.0
margin/bottom = 160.0
bbcode/enabled = false
bbcode/bbcode = ""
visible_characters = -1
percent_visible = 1.0
[node name="sprite" type="Sprite" parent="tween/area"]
texture = ExtResource( 2 )
[node name="follow" type="Sprite" parent="tween/area"]
transform/pos = Vector2( 0, 184 )
texture = ExtResource( 2 )
[node name="follow_2" type="Sprite" parent="tween/area"]
transform/pos = Vector2( 736, 0 )
texture = ExtResource( 2 )
[node name="timeline" type="HSlider" parent="."]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 40.0
margin/top = 224.0
margin/right = 760.0
margin/bottom = 240.0
range/min = 0.0
range/max = 100.0
range/step = 1.0
range/page = 0.0
range/value = 1.0
range/exp_edit = false
range/rounded = false
tick_count = 0
ticks_on_borders = false
focus_mode = 2
[connection signal="tween_step" from="tween" to="." method="_on_tween_step"]
[connection signal="value_changed" from="timeline" to="." method="_on_timeline_value_changed"]

View File

@@ -1,9 +1,9 @@
extends Control
# Member variables
var mousepos
onready var observer = get_node("../Observer")
func _fixed_process(delta):
var modetext = "Mode:\n"
@@ -24,9 +24,9 @@ func _fixed_process(delta):
if(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED):
modetext += "MouseGrab\n"
get_node("Label_MouseGrab_KeyInfo").show()
get_node("Label_MouseModeCaptured_KeyInfo").show()
else:
get_node("Label_MouseGrab_KeyInfo").hide()
get_node("Label_MouseModeCaptured_KeyInfo").hide()
get_node("Label_Mode").set_text(modetext)
@@ -66,7 +66,9 @@ func _fixed_process(delta):
get_node("Button_FixedSize").set_pressed(!OS.is_window_resizable())
get_node("Button_Minimized").set_pressed(OS.is_window_minimized())
get_node("Button_Maximized").set_pressed(OS.is_window_maximized())
get_node("Button_Mouse_Grab").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED)
get_node("Button_MouseModeVisible").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_VISIBLE)
get_node("Button_MouseModeHidden").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_HIDDEN)
get_node("Button_MouseModeCaptured").set_pressed(Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED)
func check_wm_api():
@@ -140,6 +142,18 @@ func _ready():
func _input(event):
if (event.type == InputEvent.MOUSE_MOTION):
mousepos = event.pos
if (event.type == InputEvent.KEY):
if Input.is_action_pressed("mouse_mode_visible"):
observer.state = observer.STATE_MENU
_on_Button_MouseModeVisible_pressed()
if Input.is_action_pressed("mouse_mode_hidden"):
observer.state = observer.STATE_MENU
_on_Button_MouseModeHidden_pressed()
if Input.is_action_pressed("mouse_mode_captured"):
_on_Button_MouseModeCaptured_pressed()
func _on_Button_MoveTo_pressed():
@@ -186,6 +200,13 @@ func _on_Button_Maximized_pressed():
OS.set_window_maximized(true)
func _on_Button_Mouse_Grab_pressed():
var observer = get_node("../Observer")
func _on_Button_MouseModeVisible_pressed():
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
func _on_Button_MouseModeHidden_pressed():
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
func _on_Button_MouseModeCaptured_pressed():
observer.state = observer.STATE_GRAB

View File

@@ -1,7 +1,7 @@
[application]
name="Window Management"
main_scene="res://window_management.scn"
main_scene="res://window_management.tscn"
icon="res://icon.png"
[display]
@@ -13,6 +13,9 @@ height=600
[input]
mouse_mode_visible=[key(F1)]
mouse_mode_hidden=[key(F2)]
mouse_mode_captured=[key(F3)]
move_forward=[key(W)]
move_backwards=[key(S)]
move_left=[key(A)]

View File

@@ -25,14 +25,14 @@ func impulse(event, action):
func _fixed_process(delta):
if(state != STATE_GRAB):
return
if(Input.get_mouse_mode() != Input.MOUSE_MODE_CAPTURED):
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
var dir = Vector3()
var cam = get_global_transform()
var org = get_translation()
if (Input.is_action_pressed("move_forward")):
dir += direction(Vector3(0, 0, -1))
if (Input.is_action_pressed("move_backwards")):
@@ -41,19 +41,19 @@ func _fixed_process(delta):
dir += direction(Vector3(-1, 0, 0))
if (Input.is_action_pressed("move_right")):
dir += direction(Vector3(1, 0, 0))
dir = dir.normalized()
move(dir*10*delta)
var d = delta*0.1
var yaw = get_transform().rotated(Vector3(0, 1, 0), d*r_pos.x)
set_transform(yaw)
var cam = get_node("Camera")
var pitch = cam.get_transform().rotated(Vector3(1, 0, 0), d*r_pos.y)
cam.set_transform(pitch)
r_pos.x = 0.0
r_pos.y = 0.0
@@ -61,7 +61,7 @@ func _fixed_process(delta):
func _input(event):
if(event.type == InputEvent.MOUSE_MOTION):
r_pos = event.relative_pos
if(impulse(event, "ui_cancel")):
if(state == STATE_GRAB):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
@@ -74,5 +74,5 @@ func _input(event):
func _ready():
set_fixed_process(true)
set_process_input(true)
state = STATE_MENU

View File

@@ -0,0 +1,56 @@
[gd_scene load_steps=2 format=1]
[ext_resource path="res://observer/observer.gd" type="Script" id=1]
[node name="Observer" type="KinematicBody"]
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
input/ray_pickable = true
input/capture_on_drag = false
shape_count = 0
collision/layers = 1
collision/mask = 1
collide_with/static = true
collide_with/kinematic = true
collide_with/rigid = true
collide_with/character = true
collision/margin = 0.001
script/script = ExtResource( 1 )
__meta__ = { "__editor_plugin_screen__":"3D" }
[node name="Camera" type="Camera" parent="."]
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
projection = 0
fov = 60.0
near = 0.1
far = 1000.0
keep_aspect = 1
current = false
visible_layers = 1048575
environment = null
h_offset = 0.0
v_offset = 0.0
[node name="OmniLight" type="OmniLight" parent="."]
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
layers = 1
params/enabled = true
params/editor_only = false
params/bake_mode = 0
params/energy = 1.0
colors/diffuse = Color( 1, 1, 1, 1 )
colors/specular = Color( 1, 1, 1, 1 )
shadow/shadow = false
shadow/darkening = 0.0
shadow/z_offset = 0.001
shadow/z_slope_scale = 0.0
shadow/esm_multiplier = 60.0
shadow/blur_passes = 1.0
projector = null
operator = 0
params/radius = 100.0
params/attenuation = 1.0

View File

@@ -0,0 +1,551 @@
[gd_scene load_steps=3 format=1]
[ext_resource path="res://observer/observer.tscn" type="PackedScene" id=1]
[ext_resource path="res://control.gd" type="Script" id=2]
[node name="Spatial" type="Spatial"]
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="Observer" parent="." instance=ExtResource( 1 )]
transform/local = Transform( 0.910685, 0, -0.4131, 0, 1, 0, 0.4131, 0, 0.910685, -4.81287, -0.152566, 9.90641 )
[node name="TestCube" type="TestCube" parent="."]
_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
layers = 1
geometry/visible = true
geometry/material_override = null
geometry/cast_shadow = 1
geometry/receive_shadows = true
geometry/range_begin = 0.0
geometry/range_end = 0.0
geometry/extra_cull_margin = 0.0
geometry/billboard = false
geometry/billboard_y = false
geometry/depth_scale = false
geometry/visible_in_all_rooms = false
geometry/use_baked_light = false
geometry/baked_light_tex_id = 0
[node name="Control" type="Control" parent="."]
anchor/right = 1
anchor/bottom = 1
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 0.0
margin/top = 0.0
margin/right = 0.0
margin/bottom = 0.0
script/script = ExtResource( 2 )
[node name="Button_Fullscreen" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 20.0
margin/right = 120.0
margin/bottom = 45.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "Fullscreen"
flat = false
[node name="Button_FixedSize" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 60.0
margin/right = 120.0
margin/bottom = 85.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "FixedSize"
flat = false
[node name="Button_Minimized" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 100.0
margin/right = 120.0
margin/bottom = 125.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "Minimized"
flat = false
[node name="Button_Maximized" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 140.0
margin/right = 120.0
margin/bottom = 165.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "Maximized"
flat = false
[node name="Button_MoveTo" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 178.0
margin/right = 120.0
margin/bottom = 203.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "MoveTo"
flat = false
[node name="Button_Resize" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 218.0
margin/right = 120.0
margin/bottom = 243.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "Resize"
flat = false
[node name="Button_Screen0" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 258.0
margin/right = 120.0
margin/bottom = 283.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "Screen0"
flat = false
[node name="Button_Screen1" type="Button" parent="Control"]
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 298.0
margin/right = 120.0
margin/bottom = 323.0
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
text = "Screen1"
flat = false
[node name="Button_MouseModeVisible" type="Button" parent="Control"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 221.0
margin/right = 225.0
margin/bottom = 196.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "[F1] MOUSE_MODE_VISIBLE"
flat = false
align = 0
[node name="Button_MouseModeHidden" type="Button" parent="Control"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 186.0
margin/right = 225.0
margin/bottom = 161.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "[F2] MOUSE_MODE_HIDDEN"
flat = false
align = 0
[node name="Button_MouseModeCaptured" type="Button" parent="Control"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 20.0
margin/top = 151.0
margin/right = 225.0
margin/bottom = 126.0
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
text = "[F3] MOUSE_MODE_CAPTURED"
flat = false
align = 0
[node name="Label_Mode" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 140.0
margin/right = 20.0
margin/bottom = 153.0
text = "Mode:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Position" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 60.0
margin/right = 20.0
margin/bottom = 73.0
text = "Position:"
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Size" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 100.0
margin/right = 20.0
margin/bottom = 113.0
text = "Size:"
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_MousePosition" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 220.0
margin/right = 20.0
margin/bottom = 153.0
text = "Mouse Position:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen_Count" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 300.0
margin/right = 20.0
margin/bottom = 317.0
text = "Screen_Count:"
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen_Current" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 20.0
margin/right = 20.0
margin/bottom = 40.0
text = "Screen:"
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen0_Resolution" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 340.0
margin/right = 16.0
margin/bottom = 353.0
text = "Screen0 Resolution: "
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen0_Position" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 380.0
margin/right = 16.0
margin/bottom = 396.0
text = "Screen0 Position: "
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen0_DPI" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 416.0
margin/right = 16.0
margin/bottom = 432.0
text = "Screen0 DPI:"
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen1_Resolution" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 451.0
margin/right = 16.0
margin/bottom = 467.0
text = "Screen1 Resolution: "
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen1_Position" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 489.0
margin/right = 16.0
margin/bottom = 505.0
text = "Screen1 Position: "
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_Screen1_DPI" type="Label" parent="Control"]
anchor/left = 1
anchor/right = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 140.0
margin/top = 524.0
margin/right = 16.0
margin/bottom = 540.0
text = "Screen1 DPI:"
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_KeyInfo" type="Label" parent="Control"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 20.0
margin/top = 122.0
margin/right = 286.0
margin/bottom = 63.0
text = "F1: activate MOUSE_MODE_VISIBLE\nF2: activate MOUSE_MODE_HIDDEN\nF3: activate MOUSE_MODE_CAPTURED"
valign = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_MouseModeCaptured_KeyInfo" type="Label" parent="Control"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 20.0
margin/top = 65.0
margin/right = 286.0
margin/bottom = 11.0
text = "ESC: deactivate MOUSE_MODE_CAPTURED\nW, S: move forward, backward\nA, D: strafe left, right"
valign = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="Label_MouseModes" type="Label" parent="Control"]
anchor/top = 1
anchor/bottom = 1
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 20.0
margin/top = 249.0
margin/right = 286.0
margin/bottom = 227.0
text = "MouseModes:"
valign = 2
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="ImplementationDialog" type="AcceptDialog" parent="Control"]
visibility/visible = false
focus/ignore_mouse = false
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 2
margin/left = 200.0
margin/top = 100.0
margin/right = 600.0
margin/bottom = 450.0
popup/exclusive = false
window/title = "Please be advised..."
dialog/hide_on_ok = true
[node name="Text" type="Label" parent="Control/ImplementationDialog"]
focus/ignore_mouse = true
focus/stop_mouse = true
size_flags/horizontal = 2
size_flags/vertical = 0
margin/left = 16.0
margin/top = 20.0
margin/right = 378.0
margin/bottom = 298.0
text = "This is an Implementation-Test-Demo\n\nIt is used to help implementing a new window handling api\nacross platforms.\n\nYour platform lacks at the moment the following methods:\n"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[connection signal="pressed" from="Control/Button_Fullscreen" to="Control" method="_on_Button_Fullscreen_pressed"]
[connection signal="pressed" from="Control/Button_FixedSize" to="Control" method="_on_Button_FixedSize_pressed"]
[connection signal="pressed" from="Control/Button_Minimized" to="Control" method="_on_Button_Minimized_pressed"]
[connection signal="pressed" from="Control/Button_Maximized" to="Control" method="_on_Button_Maximized_pressed"]
[connection signal="pressed" from="Control/Button_MoveTo" to="Control" method="_on_Button_MoveTo_pressed"]
[connection signal="pressed" from="Control/Button_Resize" to="Control" method="_on_Button_Resize_pressed"]
[connection signal="pressed" from="Control/Button_Screen0" to="Control" method="_on_Button_Screen0_pressed"]
[connection signal="pressed" from="Control/Button_Screen1" to="Control" method="_on_Button_Screen1_pressed"]
[connection signal="pressed" from="Control/Button_MouseModeVisible" to="Control" method="_on_Button_MouseModeVisible_pressed"]
[connection signal="pressed" from="Control/Button_MouseModeHidden" to="Control" method="_on_Button_MouseModeHidden_pressed"]
[connection signal="pressed" from="Control/Button_MouseModeCaptured" to="Control" method="_on_Button_MouseModeCaptured_pressed"]