Casset/level1
made a casset that you can pick up. Made a level 1.
This commit is contained in:
1 parent
25eabd1364
commit
1eee8b0e92
11 files changed
+297
-349
No files matched your search
@@ -324,16 +324,20 @@ func _process(_delta):
|
||||
var dir: bool = 1
|
||||
|
||||
func _physics_process(delta):
|
||||
if GloblaData.doing_puzzle == true:
|
||||
$".".global_position = $"../Marker2D2".global_position
|
||||
$Label.text = str(int(GloblaData.cassets))
|
||||
if Input.is_action_pressed("right"):
|
||||
dir = 1
|
||||
if Input.is_action_pressed("left"):
|
||||
dir = 0
|
||||
if Input.is_action_just_pressed("fire"):
|
||||
var instance = projectile.instantiate()
|
||||
if !dir:
|
||||
instance.speed = -instance.speed
|
||||
instance.position = $Marker2D.global_position
|
||||
GloblaData.test_level.add_child(instance)
|
||||
if GloblaData.doing_puzzle == false:
|
||||
if Input.is_action_just_pressed("fire"):
|
||||
var instance = projectile.instantiate()
|
||||
if !dir:
|
||||
instance.speed = -instance.speed
|
||||
instance.position = $Marker2D.global_position
|
||||
GloblaData.level_1.add_child(instance)
|
||||
if GloblaData.death_counter == 0:
|
||||
get_tree().quit()
|
||||
if GloblaData.death_counter == 2:
|
||||
@@ -363,53 +367,53 @@ func _physics_process(delta):
|
||||
|
||||
|
||||
#INFO Left and Right Movement
|
||||
|
||||
if rightHold and leftHold and movementInputMonitoring:
|
||||
if !instantStop:
|
||||
_decelerate(delta, false)
|
||||
else:
|
||||
velocity.x = -0.1
|
||||
elif rightHold and movementInputMonitoring.x:
|
||||
if velocity.x > maxSpeed or instantAccel:
|
||||
velocity.x = maxSpeed
|
||||
else:
|
||||
velocity.x += acceleration * delta
|
||||
if velocity.x < 0:
|
||||
if GloblaData.doing_puzzle == false:
|
||||
if rightHold and leftHold and movementInputMonitoring:
|
||||
if !instantStop:
|
||||
_decelerate(delta, false)
|
||||
else:
|
||||
velocity.x = -0.1
|
||||
elif leftHold and movementInputMonitoring.y:
|
||||
if velocity.x < -maxSpeed or instantAccel:
|
||||
velocity.x = -maxSpeed
|
||||
else:
|
||||
velocity.x -= acceleration * delta
|
||||
elif rightHold and movementInputMonitoring.x:
|
||||
if velocity.x > maxSpeed or instantAccel:
|
||||
velocity.x = maxSpeed
|
||||
else:
|
||||
velocity.x += acceleration * delta
|
||||
if velocity.x < 0:
|
||||
if !instantStop:
|
||||
_decelerate(delta, false)
|
||||
else:
|
||||
velocity.x = -0.1
|
||||
elif leftHold and movementInputMonitoring.y:
|
||||
if velocity.x < -maxSpeed or instantAccel:
|
||||
velocity.x = -maxSpeed
|
||||
else:
|
||||
velocity.x -= acceleration * delta
|
||||
if velocity.x > 0:
|
||||
if !instantStop:
|
||||
_decelerate(delta, false)
|
||||
else:
|
||||
velocity.x = 0.1
|
||||
|
||||
if velocity.x > 0:
|
||||
wasMovingR = true
|
||||
elif velocity.x < 0:
|
||||
wasMovingR = false
|
||||
|
||||
if rightTap:
|
||||
wasPressingR = true
|
||||
if leftTap:
|
||||
wasPressingR = false
|
||||
|
||||
if runningModifier and !runHold:
|
||||
maxSpeed = maxSpeedLock / 2
|
||||
elif is_on_floor():
|
||||
maxSpeed = maxSpeedLock
|
||||
|
||||
if !(leftHold or rightHold):
|
||||
if !instantStop:
|
||||
_decelerate(delta, false)
|
||||
else:
|
||||
velocity.x = 0.1
|
||||
|
||||
if velocity.x > 0:
|
||||
wasMovingR = true
|
||||
elif velocity.x < 0:
|
||||
wasMovingR = false
|
||||
|
||||
if rightTap:
|
||||
wasPressingR = true
|
||||
if leftTap:
|
||||
wasPressingR = false
|
||||
|
||||
if runningModifier and !runHold:
|
||||
maxSpeed = maxSpeedLock / 2
|
||||
elif is_on_floor():
|
||||
maxSpeed = maxSpeedLock
|
||||
|
||||
if !(leftHold or rightHold):
|
||||
if !instantStop:
|
||||
_decelerate(delta, false)
|
||||
else:
|
||||
velocity.x = 0
|
||||
velocity.x = 0
|
||||
|
||||
#INFO Crouching
|
||||
if crouch:
|
||||
@@ -451,81 +455,82 @@ func _physics_process(delta):
|
||||
pass
|
||||
|
||||
#INFO Jump and Gravity
|
||||
if velocity.y > 0:
|
||||
appliedGravity = gravityScale * descendingGravityFactor
|
||||
else:
|
||||
appliedGravity = gravityScale
|
||||
|
||||
if is_on_wall() and !groundPounding:
|
||||
appliedTerminalVelocity = terminalVelocity / wallSliding
|
||||
if wallLatching and ((wallLatchingModifer and latchHold) or !wallLatchingModifer):
|
||||
appliedGravity = 0
|
||||
|
||||
if velocity.y < 0:
|
||||
velocity.y += 50
|
||||
if velocity.y > 0:
|
||||
velocity.y = 0
|
||||
|
||||
if wallLatchingModifer and latchHold and movementInputMonitoring == Vector2(true, true):
|
||||
velocity.x = 0
|
||||
|
||||
elif wallSliding != 1 and velocity.y > 0:
|
||||
appliedGravity = appliedGravity / wallSliding
|
||||
elif !is_on_wall() and !groundPounding:
|
||||
appliedTerminalVelocity = terminalVelocity
|
||||
|
||||
if gravityActive:
|
||||
if velocity.y < appliedTerminalVelocity:
|
||||
velocity.y += appliedGravity
|
||||
elif velocity.y > appliedTerminalVelocity:
|
||||
velocity.y = appliedTerminalVelocity
|
||||
if GloblaData.doing_puzzle == false:
|
||||
if velocity.y > 0:
|
||||
appliedGravity = gravityScale * descendingGravityFactor
|
||||
else:
|
||||
appliedGravity = gravityScale
|
||||
|
||||
if shortHopAkaVariableJumpHeight and jumpRelease and velocity.y < 0:
|
||||
velocity.y = velocity.y / jumpVariable
|
||||
|
||||
if jumps == 1:
|
||||
if !is_on_floor() and !is_on_wall():
|
||||
if coyoteTime > 0:
|
||||
coyoteActive = true
|
||||
_coyoteTime()
|
||||
if is_on_wall() and !groundPounding:
|
||||
appliedTerminalVelocity = terminalVelocity / wallSliding
|
||||
if wallLatching and ((wallLatchingModifer and latchHold) or !wallLatchingModifer):
|
||||
appliedGravity = 0
|
||||
|
||||
if jumpTap and !is_on_wall():
|
||||
if coyoteActive:
|
||||
coyoteActive = false
|
||||
_jump()
|
||||
if jumpBuffering > 0:
|
||||
jumpWasPressed = true
|
||||
_bufferJump()
|
||||
elif jumpBuffering == 0 and coyoteTime == 0 and is_on_floor():
|
||||
_jump()
|
||||
elif jumpTap and is_on_wall() and !is_on_floor():
|
||||
if wallJump and !latched:
|
||||
_wallJump()
|
||||
elif wallJump and latched:
|
||||
_wallJump()
|
||||
elif jumpTap and is_on_floor():
|
||||
_jump()
|
||||
if velocity.y < 0:
|
||||
velocity.y += 50
|
||||
if velocity.y > 0:
|
||||
velocity.y = 0
|
||||
|
||||
if wallLatchingModifer and latchHold and movementInputMonitoring == Vector2(true, true):
|
||||
velocity.x = 0
|
||||
|
||||
elif wallSliding != 1 and velocity.y > 0:
|
||||
appliedGravity = appliedGravity / wallSliding
|
||||
elif !is_on_wall() and !groundPounding:
|
||||
appliedTerminalVelocity = terminalVelocity
|
||||
|
||||
if gravityActive:
|
||||
if velocity.y < appliedTerminalVelocity:
|
||||
velocity.y += appliedGravity
|
||||
elif velocity.y > appliedTerminalVelocity:
|
||||
velocity.y = appliedTerminalVelocity
|
||||
|
||||
if is_on_floor():
|
||||
jumpCount = jumps
|
||||
if coyoteTime > 0:
|
||||
coyoteActive = true
|
||||
else:
|
||||
coyoteActive = false
|
||||
if jumpWasPressed:
|
||||
if shortHopAkaVariableJumpHeight and jumpRelease and velocity.y < 0:
|
||||
velocity.y = velocity.y / jumpVariable
|
||||
|
||||
if jumps == 1:
|
||||
if !is_on_floor() and !is_on_wall():
|
||||
if coyoteTime > 0:
|
||||
coyoteActive = true
|
||||
_coyoteTime()
|
||||
|
||||
if jumpTap and !is_on_wall():
|
||||
if coyoteActive:
|
||||
coyoteActive = false
|
||||
_jump()
|
||||
if jumpBuffering > 0:
|
||||
jumpWasPressed = true
|
||||
_bufferJump()
|
||||
elif jumpBuffering == 0 and coyoteTime == 0 and is_on_floor():
|
||||
_jump()
|
||||
elif jumpTap and is_on_wall() and !is_on_floor():
|
||||
if wallJump and !latched:
|
||||
_wallJump()
|
||||
elif wallJump and latched:
|
||||
_wallJump()
|
||||
elif jumpTap and is_on_floor():
|
||||
_jump()
|
||||
|
||||
if is_on_floor():
|
||||
jumpCount = jumps
|
||||
if coyoteTime > 0:
|
||||
coyoteActive = true
|
||||
else:
|
||||
coyoteActive = false
|
||||
if jumpWasPressed:
|
||||
_jump()
|
||||
|
||||
elif jumps > 1:
|
||||
if is_on_floor():
|
||||
jumpCount = jumps
|
||||
if jumpTap and is_on_wall() and wallJump:
|
||||
_wallJump()
|
||||
elif jumpTap and jumpCount > 0:
|
||||
velocity.y = -jumpMagnitude
|
||||
jumpCount = jumpCount - 1
|
||||
_endGroundPound()
|
||||
|
||||
|
||||
elif jumps > 1:
|
||||
if is_on_floor():
|
||||
jumpCount = jumps
|
||||
if jumpTap and is_on_wall() and wallJump:
|
||||
_wallJump()
|
||||
elif jumpTap and jumpCount > 0:
|
||||
velocity.y = -jumpMagnitude
|
||||
jumpCount = jumpCount - 1
|
||||
_endGroundPound()
|
||||
|
||||
|
||||
#INFO dashing
|
||||
if is_on_floor():
|
||||
dashCount = dashes
|
||||
|
||||
Reference in new issue
Block a user