mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 15:00:09 +01:00
Some more ProjectSettings fixes
This commit is contained in:
@@ -9,8 +9,8 @@ run/name=""
|
|||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/height=720
|
window/size/height=720
|
||||||
window/width=1080
|
window/size/width=1080
|
||||||
|
|
||||||
[rasterizer]
|
[rasterizer]
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Kinematic Character"
|
config/name="Kinematic Character"
|
||||||
run/main_scene="res://colworld.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
config/main_scene="res://colworld.tscn"
|
run/main_scene="res://colworld.tscn"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch/aspect="keep"
|
stretch/aspect="keep"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/height=495
|
window/size/height=495
|
||||||
window/width=530
|
window/size/width=530
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ config_version=3
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Using Lights As Mask"
|
config/name="Using Lights As Mask"
|
||||||
run/main_scene="res://lightmask.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
config/main_scene="res://lightmask.tscn"
|
run/main_scene="res://lightmask.tscn"
|
||||||
|
|
||||||
[rasterizer]
|
[rasterizer]
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,15 @@ config_version=3
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="2D Lighting"
|
config/name="2D Lighting"
|
||||||
run/main_scene="res://light_shadows.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
config/main_scene="res://light_shadows.tscn"
|
run/main_scene="res://light_shadows.tscn"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch/aspect="keep"
|
stretch/aspect="keep"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/height=600
|
window/size/height=600
|
||||||
window/width=800
|
window/size/width=800
|
||||||
|
|
||||||
[rasterizer]
|
[rasterizer]
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ config/icon="res://icon.png"
|
|||||||
|
|
||||||
stretch/aspect="keep"
|
stretch/aspect="keep"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/height=600
|
window/size/height=600
|
||||||
window/width=800
|
window/size/width=800
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ name_es="Plataformero"
|
|||||||
|
|
||||||
stretch/aspect="keep_height"
|
stretch/aspect="keep_height"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/height=480
|
window/size/height=480
|
||||||
window/width=800
|
window/size/width=800
|
||||||
|
|
||||||
[image_loader]
|
[image_loader]
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ extends RigidBody2D
|
|||||||
func _on_bullet_body_enter( body ):
|
func _on_bullet_body_enter( body ):
|
||||||
if (body.has_method("hit_by_bullet")):
|
if (body.has_method("hit_by_bullet")):
|
||||||
body.call("hit_by_bullet")
|
body.call("hit_by_bullet")
|
||||||
|
|
||||||
func _on_Timer_timeout():
|
func _on_Timer_timeout():
|
||||||
get_node("anim").play("shutdown")
|
get_node("anim").play("shutdown")
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
|
||||||
extends Area2D
|
extends Area2D
|
||||||
|
|
||||||
var taken=false
|
var taken=false
|
||||||
|
|
||||||
func _on_coin_body_enter( body ):
|
func _on_coin_body_enter( body ):
|
||||||
|
|
||||||
if (not taken and body is preload("res://player.gd")):
|
if (not taken and body is preload("res://player.gd")):
|
||||||
get_node("anim").play("taken")
|
get_node("anim").play("taken")
|
||||||
taken=true
|
taken=true
|
||||||
|
|
||||||
|
|||||||
@@ -22,36 +22,36 @@ onready var detect_wall_right = get_node("detect_wall_right")
|
|||||||
onready var sprite = get_node("sprite")
|
onready var sprite = get_node("sprite")
|
||||||
|
|
||||||
func _fixed_process(delta):
|
func _fixed_process(delta):
|
||||||
|
|
||||||
var new_anim="idle"
|
var new_anim="idle"
|
||||||
|
|
||||||
if (state==STATE_WALKING):
|
if (state==STATE_WALKING):
|
||||||
|
|
||||||
linear_velocity+= GRAVITY_VEC*delta
|
linear_velocity+= GRAVITY_VEC*delta
|
||||||
linear_velocity.x = direction * WALK_SPEED
|
linear_velocity.x = direction * WALK_SPEED
|
||||||
linear_velocity = move_and_slide( linear_velocity, FLOOR_NORMAL )
|
linear_velocity = move_and_slide( linear_velocity, FLOOR_NORMAL )
|
||||||
|
|
||||||
if (not detect_floor_left.is_colliding() or detect_wall_left.is_colliding()):
|
if (not detect_floor_left.is_colliding() or detect_wall_left.is_colliding()):
|
||||||
direction=1.0
|
direction=1.0
|
||||||
|
|
||||||
if (not detect_floor_right.is_colliding() or detect_wall_right.is_colliding()):
|
if (not detect_floor_right.is_colliding() or detect_wall_right.is_colliding()):
|
||||||
direction=-1.0
|
direction=-1.0
|
||||||
|
|
||||||
sprite.set_scale( Vector2(direction,1.0) )
|
sprite.set_scale( Vector2(direction,1.0) )
|
||||||
|
|
||||||
new_anim="walk"
|
new_anim="walk"
|
||||||
else:
|
else:
|
||||||
new_anim="explode"
|
new_anim="explode"
|
||||||
|
|
||||||
|
|
||||||
if (anim!=new_anim):
|
if (anim!=new_anim):
|
||||||
anim=new_anim
|
anim=new_anim
|
||||||
get_node("anim").play(anim)
|
get_node("anim").play(anim)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func hit_by_bullet():
|
func hit_by_bullet():
|
||||||
state=STATE_KILLED
|
state=STATE_KILLED
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
set_fixed_process(true)
|
set_fixed_process(true)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ func _fixed_process(delta):
|
|||||||
accum = fmod(accum, PI*2.0)
|
accum = fmod(accum, PI*2.0)
|
||||||
var d = sin(accum)
|
var d = sin(accum)
|
||||||
var xf = Transform2D()
|
var xf = Transform2D()
|
||||||
xf[2]= motion*d
|
xf[2]= motion*d
|
||||||
get_node("platform").transform=xf
|
get_node("platform").transform=xf
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const BULLET_VELOCITY = 1000
|
|||||||
const SHOOT_TIME_SHOW_WEAPON = 0.2
|
const SHOOT_TIME_SHOW_WEAPON = 0.2
|
||||||
|
|
||||||
var linear_vel = Vector2()
|
var linear_vel = Vector2()
|
||||||
var onair_time = 0 #
|
var onair_time = 0 #
|
||||||
var on_floor = false
|
var on_floor = false
|
||||||
var shoot_time=99999 #time since last shot
|
var shoot_time=99999 #time since last shot
|
||||||
|
|
||||||
@@ -22,68 +22,68 @@ var anim=""
|
|||||||
onready var sprite = get_node("sprite")
|
onready var sprite = get_node("sprite")
|
||||||
|
|
||||||
func _fixed_process(delta):
|
func _fixed_process(delta):
|
||||||
|
|
||||||
#increment counters
|
#increment counters
|
||||||
|
|
||||||
onair_time+=delta
|
onair_time+=delta
|
||||||
shoot_time+=delta
|
shoot_time+=delta
|
||||||
|
|
||||||
|
|
||||||
### MOVEMENT ###
|
### MOVEMENT ###
|
||||||
|
|
||||||
# Apply Gravity
|
# Apply Gravity
|
||||||
linear_vel += delta * GRAVITY_VEC
|
linear_vel += delta * GRAVITY_VEC
|
||||||
# Move and Slide
|
# Move and Slide
|
||||||
linear_vel = move_and_slide( linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP )
|
linear_vel = move_and_slide( linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP )
|
||||||
# Detect Floor
|
# Detect Floor
|
||||||
if (is_on_floor()):
|
if (is_on_floor()):
|
||||||
onair_time=0
|
onair_time=0
|
||||||
|
|
||||||
on_floor = onair_time < MIN_ONAIR_TIME
|
on_floor = onair_time < MIN_ONAIR_TIME
|
||||||
|
|
||||||
### CONTROL ###
|
### CONTROL ###
|
||||||
|
|
||||||
# Horizontal Movement
|
# Horizontal Movement
|
||||||
var target_speed = 0
|
var target_speed = 0
|
||||||
if (Input.is_action_pressed("move_left")):
|
if (Input.is_action_pressed("move_left")):
|
||||||
target_speed += -1
|
target_speed += -1
|
||||||
if (Input.is_action_pressed("move_right")):
|
if (Input.is_action_pressed("move_right")):
|
||||||
target_speed += 1
|
target_speed += 1
|
||||||
|
|
||||||
target_speed *= WALK_SPEED
|
target_speed *= WALK_SPEED
|
||||||
linear_vel.x = lerp( linear_vel.x, target_speed, 0.1 )
|
linear_vel.x = lerp( linear_vel.x, target_speed, 0.1 )
|
||||||
|
|
||||||
# Jumping
|
# Jumping
|
||||||
if (on_floor and Input.is_action_just_pressed("jump")):
|
if (on_floor and Input.is_action_just_pressed("jump")):
|
||||||
linear_vel.y=-JUMP_SPEED
|
linear_vel.y=-JUMP_SPEED
|
||||||
get_node("sound_jump").play()
|
get_node("sound_jump").play()
|
||||||
|
|
||||||
# Shooting
|
# Shooting
|
||||||
|
|
||||||
if (Input.is_action_just_pressed("shoot")):
|
if (Input.is_action_just_pressed("shoot")):
|
||||||
|
|
||||||
var bullet = preload("res://bullet.tscn").instance()
|
var bullet = preload("res://bullet.tscn").instance()
|
||||||
bullet.position = get_node("sprite/bullet_shoot").global_position #use node for shoot position
|
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
|
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_parent().add_child( bullet ) #don't want bullet to move with me, so add it as child of parent
|
||||||
get_node("sound_shoot").play()
|
get_node("sound_shoot").play()
|
||||||
shoot_time=0
|
shoot_time=0
|
||||||
|
|
||||||
|
|
||||||
### ANIMATION ###
|
### ANIMATION ###
|
||||||
|
|
||||||
var new_anim="idle"
|
var new_anim="idle"
|
||||||
|
|
||||||
if (on_floor):
|
if (on_floor):
|
||||||
if (linear_vel.x < -SIDING_CHANGE_SPEED):
|
if (linear_vel.x < -SIDING_CHANGE_SPEED):
|
||||||
sprite.scale.x = -1
|
sprite.scale.x = -1
|
||||||
new_anim="run"
|
new_anim="run"
|
||||||
|
|
||||||
if (linear_vel.x > SIDING_CHANGE_SPEED):
|
if (linear_vel.x > SIDING_CHANGE_SPEED):
|
||||||
sprite.scale.x = 1
|
sprite.scale.x = 1
|
||||||
new_anim="run"
|
new_anim="run"
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# We want the character to immediately change facing side when the player
|
# We want the character to immediately change facing side when the player
|
||||||
# tries to change direction, during air control.
|
# tries to change direction, during air control.
|
||||||
@@ -97,15 +97,15 @@ func _fixed_process(delta):
|
|||||||
new_anim="jumping"
|
new_anim="jumping"
|
||||||
else:
|
else:
|
||||||
new_anim="falling"
|
new_anim="falling"
|
||||||
|
|
||||||
if (shoot_time < SHOOT_TIME_SHOW_WEAPON):
|
if (shoot_time < SHOOT_TIME_SHOW_WEAPON):
|
||||||
new_anim+="_weapon"
|
new_anim+="_weapon"
|
||||||
|
|
||||||
if (new_anim!=anim):
|
if (new_anim!=anim):
|
||||||
anim=new_anim
|
anim=new_anim
|
||||||
get_node("anim").play(anim)
|
get_node("anim").play(anim)
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
set_fixed_process(true)
|
set_fixed_process(true)
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,16 @@ config_version=3
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Platformer"
|
config/name="Platformer"
|
||||||
run/main_scene="res://stage.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
name_es="Plataformero"
|
run/main_scene="res://stage.tscn"
|
||||||
target_fps="60"
|
target_fps="60"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch/aspect="keep_height"
|
stretch/aspect="keep_height"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/height=480
|
window/size/height=480
|
||||||
window/width=800
|
window/size/width=800
|
||||||
|
|
||||||
[image_loader]
|
[image_loader]
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ config/icon="res://icon.png"
|
|||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch_2d=true
|
stretch_2d=true
|
||||||
window/height=400
|
window/size/height=400
|
||||||
window/width=640
|
window/size/width=640
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ config/icon="res://icon.png"
|
|||||||
|
|
||||||
stretch/aspect="keep"
|
stretch/aspect="keep"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/height=600
|
window/size/height=600
|
||||||
window/width=800
|
window/size/width=800
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Kinematic Character 3D"
|
config/name="Kinematic Character 3D"
|
||||||
run/main_scene="res://level.scn"
|
|
||||||
config/icon="res://kinebody3d.png"
|
config/icon="res://kinebody3d.png"
|
||||||
|
run/main_scene="res://level.scn"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Platformer 3D"
|
config/name="Platformer 3D"
|
||||||
|
config/icon="res://icon.png"
|
||||||
run/main_scene="res://stage.scn"
|
run/main_scene="res://stage.scn"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ name="Input Mapping GUI"
|
|||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/height=480
|
window/size/height=480
|
||||||
window/width=640
|
window/size/width=640
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Rich Text Label (BBCode)"
|
config/name="Rich Text Label (BBCode)"
|
||||||
run/main_scene="res://rich_text_bbcode.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
run/main_scene="res://rich_text_bbcode.tscn"
|
||||||
|
|
||||||
[memory]
|
[memory]
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Autoload (Singletons)"
|
config/name="Autoload (Singletons)"
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ config/icon="res://icon.png"
|
|||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/height=450
|
window/size/height=450
|
||||||
window/width=550
|
window/size/width=550
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Loading in a Thread"
|
config/name="Loading in a Thread"
|
||||||
|
|||||||
@@ -1,20 +1,18 @@
|
|||||||
config_version=3
|
config_version=3
|
||||||
|
|
||||||
config_version=null
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Tween Demo"
|
config/name="Tween Demo"
|
||||||
run/main_scene="res://main.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
run/main_scene="res://main.tscn"
|
||||||
target_fps=60
|
target_fps=60
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch/aspect="keep_width"
|
stretch/aspect="keep_width"
|
||||||
stretch/mode="2d"
|
stretch/mode="2d"
|
||||||
window/width=928
|
window/size/width=928
|
||||||
window/height=672
|
window/size/height=672
|
||||||
|
|
||||||
[memory]
|
[memory]
|
||||||
|
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ name="Window Management"
|
|||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/fullscreen=false
|
window/fullscreen=false
|
||||||
window/height=600
|
window/size/height=600
|
||||||
window/resizable=true
|
window/resizable=true
|
||||||
window/width=800
|
window/size/width=800
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ config_version=3
|
|||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Pong Multiplayer"
|
config/name="Pong Multiplayer"
|
||||||
run/main_scene="res://lobby.tscn"
|
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
|
run/main_scene="res://lobby.tscn"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch_2d=true
|
stretch_2d=true
|
||||||
window/height=400
|
window/size/height=400
|
||||||
window/width=640
|
window/size/width=640
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ config/icon="res://icon.png"
|
|||||||
[display]
|
[display]
|
||||||
|
|
||||||
stretch_2d=true
|
stretch_2d=true
|
||||||
window/height=400
|
window/size/height=400
|
||||||
window/width=640
|
window/size/width=640
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user