Skip to content

Commit

Permalink
WIP stunts: formatting, debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp committed Feb 26, 2023
1 parent f4d052f commit 62d3756
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resources/scripts/stunts.as
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class StuntsManager

int stuntID = this.getNewStuntID();
this.stuntList[stuntID] = b;
game.log("DEBUG: StuntsManager.addStunt(): added stunt '"+stuntName+"' with ID " + stuntID + ", stuntCount=" + this.getStuntCount());
return stuntID;
}

Expand Down Expand Up @@ -170,10 +171,11 @@ class StuntBuilder

void beginStunt(int truckNum)
{
BeamClass@ actor = game.getTruckByNum(truckNum);

// State
this.isOngoing = true;
this.truckNum = truckNum;
BeamClass@ actor = game.getTruckByNum(truckNum);
this.startPos = actor.getVehiclePosition();
this.prevPos = actor.getVehiclePosition();
this.prevYaw = actor.getHeadingDirectionAngle();
Expand All @@ -190,8 +192,9 @@ class StuntBuilder

void finishStunt()
{
this.isOngoing = false;
BeamClass@ actor = game.getTruckByNum(this.truckNum);

this.isOngoing = false;
this.pointToPointDistance += (actor.getVehiclePosition() - this.startPos).length();

string text
Expand Down

0 comments on commit 62d3756

Please sign in to comment.