mirror of
https://github.com/Steffo99/watermelonkeys-patched-ld51.git
synced 2024-11-22 08:04:19 +00:00
andre <3
This commit is contained in:
parent
f31eb7d496
commit
b5b7f566d1
14 changed files with 501 additions and 25 deletions
BIN
ASSETS/sounds/giorno1.wav
Normal file
BIN
ASSETS/sounds/giorno1.wav
Normal file
Binary file not shown.
23
ASSETS/sounds/giorno1.wav.import
Normal file
23
ASSETS/sounds/giorno1.wav.import
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamSample"
|
||||||
|
path="res://.import/giorno1.wav-af2d65e89a0aca6e7fe0c4bed3de1c9c.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://ASSETS/sounds/giorno1.wav"
|
||||||
|
dest_files=[ "res://.import/giorno1.wav-af2d65e89a0aca6e7fe0c4bed3de1c9c.sample" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
ASSETS/sounds/notte1.wav
Normal file
BIN
ASSETS/sounds/notte1.wav
Normal file
Binary file not shown.
23
ASSETS/sounds/notte1.wav.import
Normal file
23
ASSETS/sounds/notte1.wav.import
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamSample"
|
||||||
|
path="res://.import/notte1.wav-7be469264486ef6a51780eaef9e682b9.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://ASSETS/sounds/notte1.wav"
|
||||||
|
dest_files=[ "res://.import/notte1.wav-7be469264486ef6a51780eaef9e682b9.sample" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
ASSETS/sounds/salto1.wav
Normal file
BIN
ASSETS/sounds/salto1.wav
Normal file
Binary file not shown.
23
ASSETS/sounds/salto1.wav.import
Normal file
23
ASSETS/sounds/salto1.wav.import
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamSample"
|
||||||
|
path="res://.import/salto1.wav-0c07c6a37f8b13e72cb42ae01912a767.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://ASSETS/sounds/salto1.wav"
|
||||||
|
dest_files=[ "res://.import/salto1.wav-0c07c6a37f8b13e72cb42ae01912a767.sample" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
ASSETS/sounds/suoneria_giorno.wav
Normal file
BIN
ASSETS/sounds/suoneria_giorno.wav
Normal file
Binary file not shown.
23
ASSETS/sounds/suoneria_giorno.wav.import
Normal file
23
ASSETS/sounds/suoneria_giorno.wav.import
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamSample"
|
||||||
|
path="res://.import/suoneria_giorno.wav-3195d8672c362f61f290ec34b89e22e6.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://ASSETS/sounds/suoneria_giorno.wav"
|
||||||
|
dest_files=[ "res://.import/suoneria_giorno.wav-3195d8672c362f61f290ec34b89e22e6.sample" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
BIN
ASSETS/sounds/suoneria_notte.wav
Normal file
BIN
ASSETS/sounds/suoneria_notte.wav
Normal file
Binary file not shown.
23
ASSETS/sounds/suoneria_notte.wav.import
Normal file
23
ASSETS/sounds/suoneria_notte.wav.import
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="wav"
|
||||||
|
type="AudioStreamSample"
|
||||||
|
path="res://.import/suoneria_notte.wav-42c1544d119772f35296b74f19e27183.sample"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://ASSETS/sounds/suoneria_notte.wav"
|
||||||
|
dest_files=[ "res://.import/suoneria_notte.wav-42c1544d119772f35296b74f19e27183.sample" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
force/8_bit=false
|
||||||
|
force/mono=false
|
||||||
|
force/max_rate=false
|
||||||
|
force/max_rate_hz=44100
|
||||||
|
edit/trim=false
|
||||||
|
edit/normalize=false
|
||||||
|
edit/loop_mode=0
|
||||||
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=0
|
44
Level1.tscn
44
Level1.tscn
File diff suppressed because one or more lines are too long
96
Player.tscn
Normal file
96
Player.tscn
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://platformer_controller/platformer_controller.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://Giovanna.tres" type="SpriteFrames" id=2]
|
||||||
|
[ext_resource path="res://assets/sounds/salto1.wav" type="AudioStream" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=4]
|
||||||
|
extents = Vector2( 7, 15 )
|
||||||
|
|
||||||
|
[sub_resource type="GDScript" id=14]
|
||||||
|
script/source = "extends Node2D
|
||||||
|
|
||||||
|
onready var ded_timer = $DedTimer
|
||||||
|
|
||||||
|
var health := 100.0
|
||||||
|
var is_night := false
|
||||||
|
var in_light := false
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
print(\"In light: %s\" % in_light)
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
pass
|
||||||
|
if is_night:
|
||||||
|
if not in_light and ded_timer.is_stopped():
|
||||||
|
ded_timer.start(0.4)
|
||||||
|
|
||||||
|
func _on_LightCheck_entered(area):
|
||||||
|
in_light = true
|
||||||
|
# print(\"In light: %s\" % in_light)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_LightCheck_exited(area):
|
||||||
|
in_light = false
|
||||||
|
# print(\"In light: %s\" % in_light)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_cycle_started(i_n):
|
||||||
|
is_night = i_n
|
||||||
|
|
||||||
|
|
||||||
|
func _on_DedTimer_timeout():
|
||||||
|
get_tree().reload_current_scene()
|
||||||
|
"
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=16]
|
||||||
|
extents = Vector2( 9, 15 )
|
||||||
|
|
||||||
|
[node name="PlatformerController2D" type="KinematicBody2D"]
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
|
frames = ExtResource( 2 )
|
||||||
|
animation = "air"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource( 4 )
|
||||||
|
|
||||||
|
[node name="Jump_AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource( 3 )
|
||||||
|
volume_db = -28.614
|
||||||
|
|
||||||
|
[node name="Camera2D" type="Camera2D" parent="."]
|
||||||
|
offset = Vector2( 0, -48 )
|
||||||
|
current = true
|
||||||
|
limit_left = -129
|
||||||
|
limit_top = -217
|
||||||
|
limit_right = 1123
|
||||||
|
limit_bottom = 669
|
||||||
|
limit_smoothed = true
|
||||||
|
smoothing_enabled = true
|
||||||
|
editor_draw_limits = true
|
||||||
|
|
||||||
|
[node name="PlayerStatus" type="Node2D" parent="."]
|
||||||
|
script = SubResource( 14 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_group_": true
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="LightCheck" type="Area2D" parent="PlayerStatus"]
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerStatus/LightCheck"]
|
||||||
|
shape = SubResource( 4 )
|
||||||
|
|
||||||
|
[node name="DedTimer" type="Timer" parent="PlayerStatus"]
|
||||||
|
|
||||||
|
[node name="WallJump_Area2D" type="Area2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="WallJump_Area2D"]
|
||||||
|
shape = SubResource( 16 )
|
||||||
|
|
||||||
|
[connection signal="area_entered" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_entered"]
|
||||||
|
[connection signal="area_exited" from="PlayerStatus/LightCheck" to="PlayerStatus" method="_on_LightCheck_exited"]
|
||||||
|
[connection signal="timeout" from="PlayerStatus/DedTimer" to="PlayerStatus" method="_on_DedTimer_timeout"]
|
262
platformer_controller/platformer_controller.gd
Normal file
262
platformer_controller/platformer_controller.gd
Normal file
|
@ -0,0 +1,262 @@
|
||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
class_name PlatformerController2D
|
||||||
|
|
||||||
|
# Set these to the name of your action (in the Input Map)
|
||||||
|
export var input_left : String = "left"
|
||||||
|
export var input_right : String = "right"
|
||||||
|
export var input_jump : String = "jump"
|
||||||
|
|
||||||
|
# The max jump height in pixels (holding jump)
|
||||||
|
export var max_jump_height = 64 setget set_max_jump_height
|
||||||
|
# The minimum jump height (tapping jump)
|
||||||
|
export var min_jump_height = 40 setget set_min_jump_height
|
||||||
|
# The height of your jump in the air
|
||||||
|
export var double_jump_height = 100 setget set_double_jump_height
|
||||||
|
# How long it takes to get to the peak of the jump in seconds
|
||||||
|
export var jump_duration = 0.3 setget set_jump_duration
|
||||||
|
# Multiplies the gravity by this while falling
|
||||||
|
export var falling_gravity_multiplier = 1.3
|
||||||
|
# Set to 2 for double jump
|
||||||
|
export var max_jump_amount = 1
|
||||||
|
export var max_acceleration = 1500
|
||||||
|
export var friction = 8
|
||||||
|
export var can_hold_jump : bool = false
|
||||||
|
# You can still jump this many seconds after falling off a ledge
|
||||||
|
export var coyote_time : float = 0.1
|
||||||
|
# Only neccessary when can_hold_jump is off
|
||||||
|
# Pressing jump this many seconds before hitting the ground will still make you jump
|
||||||
|
export var jump_buffer : float = 0.1
|
||||||
|
|
||||||
|
|
||||||
|
# Nodes
|
||||||
|
onready var jump_asp = $Jump_AudioStreamPlayer
|
||||||
|
onready var walljump_area2d = $WallJump_Area2D
|
||||||
|
onready var camera: Camera2D = $Camera2D
|
||||||
|
onready var bg: Node2D = $BG
|
||||||
|
|
||||||
|
|
||||||
|
# not used
|
||||||
|
var max_speed = 100
|
||||||
|
var acceleration_time = 10
|
||||||
|
|
||||||
|
|
||||||
|
# These will be calcualted automatically
|
||||||
|
var default_gravity : float
|
||||||
|
var jump_velocity : float
|
||||||
|
var double_jump_velocity : float
|
||||||
|
# Multiplies the gravity by this when we release jump
|
||||||
|
var release_gravity_multiplier : float
|
||||||
|
|
||||||
|
|
||||||
|
var jumps_left : int
|
||||||
|
var holding_jump := false
|
||||||
|
|
||||||
|
var vel = Vector2()
|
||||||
|
var acc = Vector2()
|
||||||
|
|
||||||
|
onready var coyote_timer = Timer.new()
|
||||||
|
onready var jump_buffer_timer = Timer.new()
|
||||||
|
onready var wall_jump_mouse_disable_timer = Timer.new()
|
||||||
|
|
||||||
|
var last_wall_normal: Vector2 = Vector2.ZERO
|
||||||
|
|
||||||
|
|
||||||
|
func _init():
|
||||||
|
default_gravity = calculate_gravity(max_jump_height, jump_duration)
|
||||||
|
jump_velocity = calculate_jump_velocity(max_jump_height, jump_duration)
|
||||||
|
double_jump_velocity = calculate_jump_velocity2(double_jump_height, default_gravity)
|
||||||
|
release_gravity_multiplier = calculate_release_gravity_multiplier(
|
||||||
|
jump_velocity, min_jump_height, default_gravity)
|
||||||
|
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
add_child(coyote_timer)
|
||||||
|
coyote_timer.wait_time = coyote_time
|
||||||
|
coyote_timer.one_shot = true
|
||||||
|
|
||||||
|
add_child(jump_buffer_timer)
|
||||||
|
jump_buffer_timer.wait_time = jump_buffer
|
||||||
|
jump_buffer_timer.one_shot = true
|
||||||
|
|
||||||
|
add_child(wall_jump_mouse_disable_timer)
|
||||||
|
wall_jump_mouse_disable_timer.wait_time = 0.1
|
||||||
|
wall_jump_mouse_disable_timer.one_shot = true
|
||||||
|
|
||||||
|
owner.set_meta("player", self)
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
acc.x = 0
|
||||||
|
|
||||||
|
if Input.is_action_pressed("right"):
|
||||||
|
$AnimatedSprite.play("walk")
|
||||||
|
$AnimatedSprite.flip_h = true
|
||||||
|
elif Input.is_action_pressed("left"):
|
||||||
|
$AnimatedSprite.play("walk")
|
||||||
|
$AnimatedSprite.flip_h = false
|
||||||
|
else:
|
||||||
|
$AnimatedSprite.play("idle")
|
||||||
|
|
||||||
|
if not is_on_floor():
|
||||||
|
$AnimatedSprite.play("air")
|
||||||
|
|
||||||
|
if is_on_floor():
|
||||||
|
coyote_timer.start()
|
||||||
|
if is_on_wall():
|
||||||
|
coyote_timer.start()
|
||||||
|
vel.x = 0
|
||||||
|
if not coyote_timer.is_stopped():
|
||||||
|
jumps_left = max_jump_amount
|
||||||
|
|
||||||
|
|
||||||
|
if wall_jump_mouse_disable_timer.is_stopped() or is_on_wall():
|
||||||
|
if Input.is_action_pressed(input_left):
|
||||||
|
acc.x = -max_acceleration
|
||||||
|
if Input.is_action_pressed(input_right):
|
||||||
|
acc.x = max_acceleration
|
||||||
|
else:
|
||||||
|
if not is_on_wall() and not is_on_floor():
|
||||||
|
if Input.is_action_pressed(input_left) or Input.is_action_pressed(input_right):
|
||||||
|
acc.x = last_wall_normal.x * max_acceleration
|
||||||
|
|
||||||
|
|
||||||
|
# Check for ground jumps when we can hold jump
|
||||||
|
if can_hold_jump:
|
||||||
|
if Input.is_action_pressed(input_jump):
|
||||||
|
# Dont use double jump when holding down
|
||||||
|
if is_on_floor():
|
||||||
|
jump()
|
||||||
|
|
||||||
|
# Check for ground jumps when we cannot hold jump
|
||||||
|
if not can_hold_jump:
|
||||||
|
if not jump_buffer_timer.is_stopped() and is_on_floor():
|
||||||
|
jump()
|
||||||
|
|
||||||
|
# Check for jumps in the air
|
||||||
|
if Input.is_action_just_pressed(input_jump):
|
||||||
|
holding_jump = true
|
||||||
|
jump_buffer_timer.start()
|
||||||
|
|
||||||
|
# Only jump in the air when press the button down, code above already jumps when we are grounded
|
||||||
|
if not is_on_floor():
|
||||||
|
jump()
|
||||||
|
|
||||||
|
|
||||||
|
if Input.is_action_just_released(input_jump):
|
||||||
|
holding_jump = false
|
||||||
|
|
||||||
|
|
||||||
|
var gravity = default_gravity
|
||||||
|
|
||||||
|
if vel.y > 0: # If we are falling
|
||||||
|
gravity *= falling_gravity_multiplier
|
||||||
|
|
||||||
|
if not holding_jump and vel.y < 0: # if we released jump and are still rising
|
||||||
|
if not jumps_left < max_jump_amount - 1: # Always jump to max height when we are using a double jump
|
||||||
|
gravity *= release_gravity_multiplier # multiply the gravity so we have a lower jump
|
||||||
|
|
||||||
|
if is_on_wall() and vel.y > 0:
|
||||||
|
acc.y = -gravity/5
|
||||||
|
vel.y = clamp(vel.y, 0, 500)
|
||||||
|
else:
|
||||||
|
acc.y = -gravity
|
||||||
|
vel.x *= 1 / (1 + (delta * friction))
|
||||||
|
|
||||||
|
# Wall jump off wall
|
||||||
|
if Input.is_action_just_pressed("jump") and is_on_wall() and not is_on_floor():
|
||||||
|
var zero_collision = get_slide_collision(0)
|
||||||
|
if zero_collision:
|
||||||
|
last_wall_normal = zero_collision.normal
|
||||||
|
vel.x += zero_collision.normal.x * 250
|
||||||
|
wall_jump_mouse_disable_timer.start()
|
||||||
|
|
||||||
|
vel += acc * delta
|
||||||
|
|
||||||
|
vel = move_and_slide(vel, Vector2.UP)
|
||||||
|
|
||||||
|
|
||||||
|
func jump():
|
||||||
|
if jumps_left == max_jump_amount and coyote_timer.is_stopped():
|
||||||
|
# Your first jump must be used when on the ground
|
||||||
|
# If you fall off the ground and then jump you will be using you second jump
|
||||||
|
jumps_left -= 1
|
||||||
|
|
||||||
|
if jumps_left > 0:
|
||||||
|
if jumps_left < max_jump_amount: # If we are double jumping
|
||||||
|
vel.y = -double_jump_velocity
|
||||||
|
else:
|
||||||
|
vel.y = -jump_velocity
|
||||||
|
jumps_left -= 1
|
||||||
|
jump_asp.play()
|
||||||
|
|
||||||
|
coyote_timer.stop()
|
||||||
|
|
||||||
|
|
||||||
|
func calculate_gravity(p_max_jump_height, p_jump_duration):
|
||||||
|
# Calculates the desired gravity by looking at our jump height and jump duration
|
||||||
|
# Formula is from this video https://www.youtube.com/watch?v=hG9SzQxaCm8
|
||||||
|
return (-2 *p_max_jump_height) / pow(p_jump_duration, 2)
|
||||||
|
|
||||||
|
|
||||||
|
func calculate_jump_velocity(p_max_jump_height, p_jump_duration):
|
||||||
|
# Calculates the desired jump velocity by lookihg at our jump height and jump duration
|
||||||
|
return (2 * p_max_jump_height) / (p_jump_duration)
|
||||||
|
|
||||||
|
|
||||||
|
func calculate_jump_velocity2(p_max_jump_height, p_gravity):
|
||||||
|
# Calculates jump velocity from jump height and gravity
|
||||||
|
# formula from
|
||||||
|
# https://sciencing.com/acceleration-velocity-distance-7779124.html#:~:text=in%20every%20step.-,Starting%20from%3A,-v%5E2%3Du
|
||||||
|
return sqrt(-2 * p_gravity * p_max_jump_height)
|
||||||
|
|
||||||
|
|
||||||
|
func calculate_release_gravity_multiplier(p_jump_velocity, p_min_jump_height, p_gravity):
|
||||||
|
# Calculates the gravity when the key is released based on the minimum jump height and jump velocity
|
||||||
|
# Formula is from this website https://sciencing.com/acceleration-velocity-distance-7779124.html
|
||||||
|
var release_gravity = 0 - pow(p_jump_velocity, 2) / (2 * p_min_jump_height)
|
||||||
|
return release_gravity / p_gravity
|
||||||
|
|
||||||
|
|
||||||
|
func calculate_friction(time_to_max):
|
||||||
|
# Formula from https://www.reddit.com/r/gamedev/comments/bdbery/comment/ekxw9g4/?utm_source=share&utm_medium=web2x&context=3
|
||||||
|
# this friction will hit 90% of max speed after the accel time
|
||||||
|
return 1 - (2.30259 / time_to_max)
|
||||||
|
|
||||||
|
|
||||||
|
func calculate_speed(p_max_speed, p_friction):
|
||||||
|
# Formula from https://www.reddit.com/r/gamedev/comments/bdbery/comment/ekxw9g4/?utm_source=share&utm_medium=web2x&context=3
|
||||||
|
return (p_max_speed / p_friction) - p_max_speed
|
||||||
|
|
||||||
|
|
||||||
|
func set_max_jump_height(value):
|
||||||
|
max_jump_height = value
|
||||||
|
|
||||||
|
default_gravity = calculate_gravity(max_jump_height, jump_duration)
|
||||||
|
jump_velocity = calculate_jump_velocity(max_jump_height, jump_duration)
|
||||||
|
double_jump_velocity = calculate_jump_velocity2(double_jump_height, default_gravity)
|
||||||
|
release_gravity_multiplier = calculate_release_gravity_multiplier(
|
||||||
|
jump_velocity, min_jump_height, default_gravity)
|
||||||
|
|
||||||
|
|
||||||
|
func set_jump_duration(value):
|
||||||
|
jump_duration = value
|
||||||
|
|
||||||
|
default_gravity = calculate_gravity(max_jump_height, jump_duration)
|
||||||
|
jump_velocity = calculate_jump_velocity(max_jump_height, jump_duration)
|
||||||
|
double_jump_velocity = calculate_jump_velocity2(double_jump_height, default_gravity)
|
||||||
|
release_gravity_multiplier = calculate_release_gravity_multiplier(
|
||||||
|
jump_velocity, min_jump_height, default_gravity)
|
||||||
|
|
||||||
|
|
||||||
|
func set_min_jump_height(value):
|
||||||
|
min_jump_height = value
|
||||||
|
release_gravity_multiplier = calculate_release_gravity_multiplier(
|
||||||
|
jump_velocity, min_jump_height, default_gravity)
|
||||||
|
|
||||||
|
|
||||||
|
func set_double_jump_height(value):
|
||||||
|
double_jump_height = value
|
||||||
|
double_jump_velocity = calculate_jump_velocity2(double_jump_height, default_gravity)
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,16 @@ _global_script_classes=[ {
|
||||||
"class": "Giovanna",
|
"class": "Giovanna",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
"path": "res://Giovanna.gd"
|
"path": "res://Giovanna.gd"
|
||||||
|
}, {
|
||||||
|
"base": "KinematicBody2D",
|
||||||
|
"class": "PlatformerController2D",
|
||||||
|
"language": "GDScript",
|
||||||
|
"path": "res://platformer_controller/platformer_controller.gd"
|
||||||
} ]
|
} ]
|
||||||
_global_script_class_icons={
|
_global_script_class_icons={
|
||||||
"Enemy": "",
|
"Enemy": "",
|
||||||
"Giovanna": ""
|
"Giovanna": "",
|
||||||
|
"PlatformerController2D": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
@ -34,7 +40,6 @@ config/icon="res://icon.png"
|
||||||
|
|
||||||
window/size/width=480
|
window/size/width=480
|
||||||
window/size/height=270
|
window/size/height=270
|
||||||
window/size/resizable=false
|
|
||||||
window/size/test_width=960
|
window/size/test_width=960
|
||||||
window/size/test_height=540
|
window/size/test_height=540
|
||||||
window/stretch/mode="viewport"
|
window/stretch/mode="viewport"
|
||||||
|
|
Loading…
Reference in a new issue