From 9365e97c0f6cb3dc9c355d6d6e03988a1230b871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 26 Jul 2017 20:25:57 +0200 Subject: [PATCH] Some more ProjectSettings fixes --- 2d/hdr/project.godot | 4 +- 2d/kinematic_character/project.godot | 9 ++-- 2d/light2d_as_mask/project.godot | 3 +- 2d/lights_and_shadows/project.godot | 7 ++- 2d/navigation/project.godot | 4 +- 2d/physics_platformer/project.godot | 4 +- 2d/platformer/bullet.gd | 2 +- 2d/platformer/coin.gd | 6 +-- 2d/platformer/enemy.gd | 26 +++++------ 2d/platformer/moving_platform.gd | 2 +- 2d/platformer/player.gd | 54 +++++++++++------------ 2d/platformer/project.godot | 7 ++- 2d/pong/project.godot | 4 +- 2d/screen_space_shaders/project.godot | 4 +- 3d/kinematic_character/project.godot | 4 +- 3d/platformer/project.godot | 3 +- gui/input_mapping/project.godot | 4 +- gui/rich_text_bbcode/project.godot | 4 +- misc/autoload/project.godot | 2 - misc/joypads/project.godot | 4 +- misc/threads/project.godot | 2 - misc/tween/project.godot | 8 ++-- misc/window_management/project.godot | 4 +- networking/multiplayer_pong/project.godot | 6 +-- visual_script/visual_pong/project.godot | 4 +- 25 files changed, 82 insertions(+), 99 deletions(-) diff --git a/2d/hdr/project.godot b/2d/hdr/project.godot index 049c2e3f..f2592097 100644 --- a/2d/hdr/project.godot +++ b/2d/hdr/project.godot @@ -9,8 +9,8 @@ run/name="" [display] -window/height=720 -window/width=1080 +window/size/height=720 +window/size/width=1080 [rasterizer] diff --git a/2d/kinematic_character/project.godot b/2d/kinematic_character/project.godot index 3de148c4..cbe1ef03 100644 --- a/2d/kinematic_character/project.godot +++ b/2d/kinematic_character/project.godot @@ -1,20 +1,17 @@ config_version=3 -config_version=null - [application] config/name="Kinematic Character" -run/main_scene="res://colworld.tscn" config/icon="res://icon.png" -config/main_scene="res://colworld.tscn" +run/main_scene="res://colworld.tscn" [display] stretch/aspect="keep" stretch/mode="2d" -window/height=495 -window/width=530 +window/size/height=495 +window/size/width=530 [input] diff --git a/2d/light2d_as_mask/project.godot b/2d/light2d_as_mask/project.godot index a63a973b..f98f9cd9 100644 --- a/2d/light2d_as_mask/project.godot +++ b/2d/light2d_as_mask/project.godot @@ -3,9 +3,8 @@ config_version=3 [application] config/name="Using Lights As Mask" -run/main_scene="res://lightmask.tscn" config/icon="res://icon.png" -config/main_scene="res://lightmask.tscn" +run/main_scene="res://lightmask.tscn" [rasterizer] diff --git a/2d/lights_and_shadows/project.godot b/2d/lights_and_shadows/project.godot index d0df6d64..39e1eb81 100644 --- a/2d/lights_and_shadows/project.godot +++ b/2d/lights_and_shadows/project.godot @@ -3,16 +3,15 @@ config_version=3 [application] config/name="2D Lighting" -run/main_scene="res://light_shadows.tscn" config/icon="res://icon.png" -config/main_scene="res://light_shadows.tscn" +run/main_scene="res://light_shadows.tscn" [display] stretch/aspect="keep" stretch/mode="2d" -window/height=600 -window/width=800 +window/size/height=600 +window/size/width=800 [rasterizer] diff --git a/2d/navigation/project.godot b/2d/navigation/project.godot index f9c98e62..fb2ab420 100644 --- a/2d/navigation/project.godot +++ b/2d/navigation/project.godot @@ -10,5 +10,5 @@ config/icon="res://icon.png" stretch/aspect="keep" stretch/mode="2d" -window/height=600 -window/width=800 +window/size/height=600 +window/size/width=800 diff --git a/2d/physics_platformer/project.godot b/2d/physics_platformer/project.godot index 14ca1b0b..57df06cd 100644 --- a/2d/physics_platformer/project.godot +++ b/2d/physics_platformer/project.godot @@ -12,8 +12,8 @@ name_es="Plataformero" stretch/aspect="keep_height" stretch/mode="2d" -window/height=480 -window/width=800 +window/size/height=480 +window/size/width=800 [image_loader] diff --git a/2d/platformer/bullet.gd b/2d/platformer/bullet.gd index 5bfa2505..f8a6cfe5 100644 --- a/2d/platformer/bullet.gd +++ b/2d/platformer/bullet.gd @@ -4,6 +4,6 @@ extends RigidBody2D func _on_bullet_body_enter( body ): if (body.has_method("hit_by_bullet")): body.call("hit_by_bullet") - + func _on_Timer_timeout(): get_node("anim").play("shutdown") diff --git a/2d/platformer/coin.gd b/2d/platformer/coin.gd index 2cc5375d..3220bb1e 100644 --- a/2d/platformer/coin.gd +++ b/2d/platformer/coin.gd @@ -1,11 +1,11 @@ extends Area2D - + var taken=false func _on_coin_body_enter( body ): - + if (not taken and body is preload("res://player.gd")): get_node("anim").play("taken") taken=true - + diff --git a/2d/platformer/enemy.gd b/2d/platformer/enemy.gd index b91d546c..f7d3e5b8 100644 --- a/2d/platformer/enemy.gd +++ b/2d/platformer/enemy.gd @@ -22,36 +22,36 @@ onready var detect_wall_right = get_node("detect_wall_right") onready var sprite = get_node("sprite") func _fixed_process(delta): - + var new_anim="idle" - + if (state==STATE_WALKING): - + linear_velocity+= GRAVITY_VEC*delta linear_velocity.x = direction * WALK_SPEED linear_velocity = move_and_slide( linear_velocity, FLOOR_NORMAL ) - + if (not detect_floor_left.is_colliding() or detect_wall_left.is_colliding()): direction=1.0 - + if (not detect_floor_right.is_colliding() or detect_wall_right.is_colliding()): direction=-1.0 - + sprite.set_scale( Vector2(direction,1.0) ) - + new_anim="walk" else: new_anim="explode" - - + + if (anim!=new_anim): anim=new_anim get_node("anim").play(anim) - - - + + + func hit_by_bullet(): - state=STATE_KILLED + state=STATE_KILLED func _ready(): set_fixed_process(true) diff --git a/2d/platformer/moving_platform.gd b/2d/platformer/moving_platform.gd index 949f0e48..ac371a6d 100644 --- a/2d/platformer/moving_platform.gd +++ b/2d/platformer/moving_platform.gd @@ -12,7 +12,7 @@ func _fixed_process(delta): accum = fmod(accum, PI*2.0) var d = sin(accum) var xf = Transform2D() - xf[2]= motion*d + xf[2]= motion*d get_node("platform").transform=xf diff --git a/2d/platformer/player.gd b/2d/platformer/player.gd index 2a048c0b..8f092928 100644 --- a/2d/platformer/player.gd +++ b/2d/platformer/player.gd @@ -12,7 +12,7 @@ const BULLET_VELOCITY = 1000 const SHOOT_TIME_SHOW_WEAPON = 0.2 var linear_vel = Vector2() -var onair_time = 0 # +var onair_time = 0 # var on_floor = false var shoot_time=99999 #time since last shot @@ -22,68 +22,68 @@ var anim="" onready var sprite = get_node("sprite") func _fixed_process(delta): - + #increment counters - + onair_time+=delta shoot_time+=delta - - + + ### MOVEMENT ### - + # Apply Gravity linear_vel += delta * GRAVITY_VEC # Move and Slide linear_vel = move_and_slide( linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP ) # Detect Floor if (is_on_floor()): - onair_time=0 - + onair_time=0 + on_floor = onair_time < MIN_ONAIR_TIME - + ### CONTROL ### - + # Horizontal Movement var target_speed = 0 if (Input.is_action_pressed("move_left")): target_speed += -1 if (Input.is_action_pressed("move_right")): target_speed += 1 - + target_speed *= WALK_SPEED linear_vel.x = lerp( linear_vel.x, target_speed, 0.1 ) - + # Jumping if (on_floor and Input.is_action_just_pressed("jump")): linear_vel.y=-JUMP_SPEED get_node("sound_jump").play() - - # Shooting - + + # Shooting + if (Input.is_action_just_pressed("shoot")): - + var bullet = preload("res://bullet.tscn").instance() bullet.position = get_node("sprite/bullet_shoot").global_position #use node for shoot position - bullet.linear_velocity = Vector2( sprite.scale.x * BULLET_VELOCITY,0 ) + bullet.linear_velocity = Vector2( sprite.scale.x * BULLET_VELOCITY,0 ) bullet.add_collision_exception_with(self) # don't want player to collide with bullet get_parent().add_child( bullet ) #don't want bullet to move with me, so add it as child of parent get_node("sound_shoot").play() shoot_time=0 - - + + ### ANIMATION ### - + var new_anim="idle" - + if (on_floor): if (linear_vel.x < -SIDING_CHANGE_SPEED): sprite.scale.x = -1 new_anim="run" - + if (linear_vel.x > SIDING_CHANGE_SPEED): sprite.scale.x = 1 new_anim="run" - + else: # We want the character to immediately change facing side when the player # tries to change direction, during air control. @@ -97,15 +97,15 @@ func _fixed_process(delta): new_anim="jumping" else: new_anim="falling" - + if (shoot_time < SHOOT_TIME_SHOW_WEAPON): new_anim+="_weapon" - + if (new_anim!=anim): anim=new_anim get_node("anim").play(anim) - - + + func _ready(): set_fixed_process(true) diff --git a/2d/platformer/project.godot b/2d/platformer/project.godot index f38b6469..6af4fdbe 100644 --- a/2d/platformer/project.godot +++ b/2d/platformer/project.godot @@ -3,17 +3,16 @@ config_version=3 [application] config/name="Platformer" -run/main_scene="res://stage.tscn" config/icon="res://icon.png" -name_es="Plataformero" +run/main_scene="res://stage.tscn" target_fps="60" [display] stretch/aspect="keep_height" stretch/mode="2d" -window/height=480 -window/width=800 +window/size/height=480 +window/size/width=800 [image_loader] diff --git a/2d/pong/project.godot b/2d/pong/project.godot index 90030a13..bfebdd71 100644 --- a/2d/pong/project.godot +++ b/2d/pong/project.godot @@ -9,8 +9,8 @@ config/icon="res://icon.png" [display] stretch_2d=true -window/height=400 -window/width=640 +window/size/height=400 +window/size/width=640 [input] diff --git a/2d/screen_space_shaders/project.godot b/2d/screen_space_shaders/project.godot index 360bc10d..7f224d71 100644 --- a/2d/screen_space_shaders/project.godot +++ b/2d/screen_space_shaders/project.godot @@ -10,5 +10,5 @@ config/icon="res://icon.png" stretch/aspect="keep" stretch/mode="2d" -window/height=600 -window/width=800 +window/size/height=600 +window/size/width=800 diff --git a/3d/kinematic_character/project.godot b/3d/kinematic_character/project.godot index c17f349f..2e2b2d5b 100644 --- a/3d/kinematic_character/project.godot +++ b/3d/kinematic_character/project.godot @@ -1,12 +1,10 @@ config_version=3 -config_version=null - [application] config/name="Kinematic Character 3D" -run/main_scene="res://level.scn" config/icon="res://kinebody3d.png" +run/main_scene="res://level.scn" [input] diff --git a/3d/platformer/project.godot b/3d/platformer/project.godot index 110bed28..d6379e0b 100644 --- a/3d/platformer/project.godot +++ b/3d/platformer/project.godot @@ -1,10 +1,9 @@ config_version=3 -config_version=null - [application] config/name="Platformer 3D" +config/icon="res://icon.png" run/main_scene="res://stage.scn" [input] diff --git a/gui/input_mapping/project.godot b/gui/input_mapping/project.godot index 198a8f97..0ab591c3 100644 --- a/gui/input_mapping/project.godot +++ b/gui/input_mapping/project.godot @@ -11,8 +11,8 @@ name="Input Mapping GUI" [display] -window/height=480 -window/width=640 +window/size/height=480 +window/size/width=640 [input] diff --git a/gui/rich_text_bbcode/project.godot b/gui/rich_text_bbcode/project.godot index d3f557c0..ba14fbff 100644 --- a/gui/rich_text_bbcode/project.godot +++ b/gui/rich_text_bbcode/project.godot @@ -1,12 +1,10 @@ config_version=3 -config_version=null - [application] config/name="Rich Text Label (BBCode)" -run/main_scene="res://rich_text_bbcode.tscn" config/icon="res://icon.png" +run/main_scene="res://rich_text_bbcode.tscn" [memory] diff --git a/misc/autoload/project.godot b/misc/autoload/project.godot index 71a5004a..d89c4214 100644 --- a/misc/autoload/project.godot +++ b/misc/autoload/project.godot @@ -1,7 +1,5 @@ config_version=3 -config_version=null - [application] config/name="Autoload (Singletons)" diff --git a/misc/joypads/project.godot b/misc/joypads/project.godot index 7394443b..b3bc3302 100644 --- a/misc/joypads/project.godot +++ b/misc/joypads/project.godot @@ -8,5 +8,5 @@ config/icon="res://icon.png" [display] -window/height=450 -window/width=550 +window/size/height=450 +window/size/width=550 diff --git a/misc/threads/project.godot b/misc/threads/project.godot index 414f4438..a0547c27 100644 --- a/misc/threads/project.godot +++ b/misc/threads/project.godot @@ -1,7 +1,5 @@ config_version=3 -config_version=null - [application] config/name="Loading in a Thread" diff --git a/misc/tween/project.godot b/misc/tween/project.godot index 858d8546..4ae93cc8 100644 --- a/misc/tween/project.godot +++ b/misc/tween/project.godot @@ -1,20 +1,18 @@ config_version=3 -config_version=null - [application] config/name="Tween Demo" -run/main_scene="res://main.tscn" config/icon="res://icon.png" +run/main_scene="res://main.tscn" target_fps=60 [display] stretch/aspect="keep_width" stretch/mode="2d" -window/width=928 -window/height=672 +window/size/width=928 +window/size/height=672 [memory] diff --git a/misc/window_management/project.godot b/misc/window_management/project.godot index 7bcca73d..30ff1648 100644 --- a/misc/window_management/project.godot +++ b/misc/window_management/project.godot @@ -12,9 +12,9 @@ name="Window Management" [display] window/fullscreen=false -window/height=600 +window/size/height=600 window/resizable=true -window/width=800 +window/size/width=800 [input] diff --git a/networking/multiplayer_pong/project.godot b/networking/multiplayer_pong/project.godot index d92cdfbd..61d03c75 100644 --- a/networking/multiplayer_pong/project.godot +++ b/networking/multiplayer_pong/project.godot @@ -3,14 +3,14 @@ config_version=3 [application] config/name="Pong Multiplayer" -run/main_scene="res://lobby.tscn" config/icon="res://icon.png" +run/main_scene="res://lobby.tscn" [display] stretch_2d=true -window/height=400 -window/width=640 +window/size/height=400 +window/size/width=640 [input] diff --git a/visual_script/visual_pong/project.godot b/visual_script/visual_pong/project.godot index 68ac60d3..a8d716da 100644 --- a/visual_script/visual_pong/project.godot +++ b/visual_script/visual_pong/project.godot @@ -9,8 +9,8 @@ config/icon="res://icon.png" [display] stretch_2d=true -window/height=400 -window/width=640 +window/size/height=400 +window/size/width=640 [input]