Audio additions: jump.ogg - comitting to continue development in another environment.
Release / Export Game (push) Successful in 2m0s
Release / Export Game (push) Successful in 2m0s
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,19 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="oggvorbisstr"
|
||||||
|
type="AudioStreamOggVorbis"
|
||||||
|
uid="uid://dkx1v6c7vv0iq"
|
||||||
|
path="res://.godot/imported/jump.ogg-d217a70c8ca2fe077e37d9f442c771d3.oggvorbisstr"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sounds/sfx/jump.ogg"
|
||||||
|
dest_files=["res://.godot/imported/jump.ogg-d217a70c8ca2fe077e37d9f442c771d3.oggvorbisstr"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
loop=false
|
||||||
|
loop_offset=0
|
||||||
|
bpm=0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
@@ -4,6 +4,12 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
public enum JumpKind {
|
||||||
|
Ground,
|
||||||
|
Turnback,
|
||||||
|
Midair
|
||||||
|
}
|
||||||
|
|
||||||
public partial class PlayerPhysicsController : CharacterBody2D {
|
public partial class PlayerPhysicsController : CharacterBody2D {
|
||||||
// [Export]
|
// [Export]
|
||||||
// public float RunMultiplier { get; set; } = 1.84f;
|
// public float RunMultiplier { get; set; } = 1.84f;
|
||||||
@@ -11,6 +17,10 @@ public partial class PlayerPhysicsController : CharacterBody2D {
|
|||||||
[Signal]
|
[Signal]
|
||||||
public delegate void OnTurnbackJumpEventHandler(bool onJumpPoint, bool isOnWall);
|
public delegate void OnTurnbackJumpEventHandler(bool onJumpPoint, bool isOnWall);
|
||||||
|
|
||||||
|
[Signal]
|
||||||
|
public delegate void OnJumpEventHandler(JumpKind kind, bool isOnGround, bool isOnWall);
|
||||||
|
|
||||||
|
|
||||||
[ExportCategory("Accelerations and Impulses")]
|
[ExportCategory("Accelerations and Impulses")]
|
||||||
[Export]
|
[Export]
|
||||||
public float WalkAcceleration { get; set; } = 3f;
|
public float WalkAcceleration { get; set; } = 3f;
|
||||||
@@ -134,6 +144,7 @@ public partial class PlayerPhysicsController : CharacterBody2D {
|
|||||||
else _timeOffGround += (float)delta;
|
else _timeOffGround += (float)delta;
|
||||||
|
|
||||||
if (Input.IsActionJustPressed("jump")) {
|
if (Input.IsActionJustPressed("jump")) {
|
||||||
|
EmitSignal(SignalName.OnJump, (int)JumpKind.Ground, this.IsOnFloor(), this.IsOnWall());
|
||||||
vely = -_lv;
|
vely = -_lv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,6 +164,7 @@ public partial class PlayerPhysicsController : CharacterBody2D {
|
|||||||
var side = velx > 0 ? PredictiveCollisions.Location.BottomRight : PredictiveCollisions.Location.BottomLeft;
|
var side = velx > 0 ? PredictiveCollisions.Location.BottomRight : PredictiveCollisions.Location.BottomLeft;
|
||||||
if (Predictor.AnyHit(side) && !this.IsOnWall()) {
|
if (Predictor.AnyHit(side) && !this.IsOnWall()) {
|
||||||
EmitSignal(SignalName.OnTurnbackJump, true, this.IsOnWall());
|
EmitSignal(SignalName.OnTurnbackJump, true, this.IsOnWall());
|
||||||
|
EmitSignal(SignalName.OnJump, (int)JumpKind.Turnback, this.IsOnFloor(), this.IsOnWall());
|
||||||
var hits = Predictor.GetLastCastHits(side);
|
var hits = Predictor.GetLastCastHits(side);
|
||||||
_ = hits.First(x => {
|
_ = hits.First(x => {
|
||||||
if (x.Obj is null) return false;
|
if (x.Obj is null) return false;
|
||||||
@@ -194,6 +206,7 @@ public partial class PlayerPhysicsController : CharacterBody2D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Input.IsActionJustPressed("jump") && Mathf.Abs(vely) < 2) {
|
if (Input.IsActionJustPressed("jump") && Mathf.Abs(vely) < 2) {
|
||||||
|
EmitSignal(SignalName.OnJump, (int)JumpKind.Midair, this.IsOnFloor(), this.IsOnWall());
|
||||||
vely = -_lv;
|
vely = -_lv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
extends AudioStreamPlayer
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
uid://bwgqvwybyrsmq
|
||||||
Reference in New Issue
Block a user