Add new bullet trajectories
This commit is contained in:
@@ -7,6 +7,7 @@ import Dodge.Creature.Impulse
|
||||
import Dodge.Creature.Picture
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.Default
|
||||
import Dodge.Movement.Turn
|
||||
--import Dodge.Creature.Impulse.UseItem
|
||||
import Dodge.FloorItem
|
||||
import Dodge.Wall.Delete
|
||||
@@ -109,16 +110,6 @@ updateTurret rotSpeed mc w
|
||||
| closeFireAngle = machines . ix mcid . mcType . tuFireTime .~ 20
|
||||
| otherwise = machines . ix mcid . mcType . tuFireTime %~ (max 0 . subtract 1)
|
||||
|
||||
turnTo :: Float -> Point2 -> Point2 -> Float -> Float
|
||||
turnTo turnSpeed sp tp a
|
||||
| vToTarg == V2 0 0 = a
|
||||
| angleVV vToTarg vdir <= turnSpeed
|
||||
= argV vToTarg
|
||||
| isLHS (sp +.+ vdir) sp tp = a - turnSpeed
|
||||
| otherwise = a + turnSpeed
|
||||
where
|
||||
vdir = unitVectorAtAngle a
|
||||
vToTarg = tp -.- sp
|
||||
|
||||
drawTurret :: Machine -> SPic
|
||||
drawTurret mc = (rotateSH (-_mcDir mc) . colorSH blue $ upperPrismPoly 20 (square wdth)
|
||||
|
||||
Reference in New Issue
Block a user