Implement simple flak and frag bullets
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Dodge.EnergyBall
|
||||
( updateEnergyBall
|
||||
, incBallAt
|
||||
, makeFlashBall
|
||||
, makeFlamelet
|
||||
) where
|
||||
|
||||
@@ -70,6 +71,26 @@ incBallAt p w =
|
||||
, _ebRot = rot
|
||||
}
|
||||
|
||||
makeFlashBall :: Point2 -> World -> World
|
||||
makeFlashBall p w =
|
||||
w & cWorld . lWorld . energyBalls .:~ theincball
|
||||
& randGen .~ g
|
||||
where
|
||||
(theincball, g) = runState thestate (_randGen w)
|
||||
thestate = do
|
||||
rot <- state $ randomR (0, 3)
|
||||
return
|
||||
EnergyBall
|
||||
{ _ebVel = 0
|
||||
, _ebColor = yellow
|
||||
, _ebPos = p
|
||||
, _ebWidth = 3
|
||||
, _ebTimer = 20
|
||||
, _ebEff = (LASERING, 1)
|
||||
, _ebZ = 20
|
||||
, _ebRot = rot
|
||||
}
|
||||
|
||||
ebFlicker :: EnergyBall -> World -> World
|
||||
ebFlicker pt
|
||||
| _ebTimer pt `mod` 7 == 0 =
|
||||
|
||||
Reference in New Issue
Block a user