# HG changeset patch # User mikade # Date 1460264409 -32400 # Node ID b4d621700bbb44ef4abd0252b1a97bb635dc8f98 # Parent e80fc50457a270cf2f4c6cda7f022f3bfe39d876 Allow variable boost directions in Racer diff -r e80fc50457a2 -r b4d621700bbb share/hedgewars/Data/Scripts/Multiplayer/Racer.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Thu Apr 07 11:53:20 2016 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Racer.lua Sun Apr 10 14:00:09 2016 +0900 @@ -1,6 +1,6 @@ ------------------------------------------ --- RACER 0.6 +-- RACER 0.8 -- map-independant racing script -- by mikade ----------------------------------------- @@ -73,6 +73,11 @@ -- switch to first available weapon if starting race with no weapon selected +------- +-- 0.8 +------- +-- allow different boost directions + ----------------------------- -- SCRIPT BEGINS ----------------------------- @@ -151,6 +156,10 @@ local lastRound local RoundHasChanged +local boostX = 0 +local boostY = 0 +local boostValue = 1 + ------------------- -- general methods ------------------- @@ -224,6 +233,31 @@ -- RACER METHODS ----------------- +function onLeft() + boostX = boostX +boostValue +end +function onLeftUp() + boostX = boostX -boostValue +end +function onRight() + boostX = boostX -boostValue +end +function onRightUp() + boostX = boostX +boostValue +end +function onUp() + boostY = boostY +boostValue +end +function onUpUp() + boostY = boostY -boostValue +end +function onDown() + boostY = boostY -boostValue +end +function onDownUp() + boostY = boostY +boostValue +end + function CheckWaypoints() trackFinished = true