Add new bullet trajectories
This commit is contained in:
@@ -7,6 +7,7 @@ module Dodge.Particle.Bullet.Spawn
|
||||
import Dodge.Data
|
||||
import Dodge.Particle.Bullet.Draw
|
||||
import Dodge.Particle.Bullet.Update
|
||||
import Dodge.Movement.Turn
|
||||
import Geometry
|
||||
import Picture
|
||||
import LensHelp
|
||||
@@ -105,3 +106,28 @@ accelBulAt maycid col pos vel acc hiteff width = BulletPt
|
||||
}
|
||||
where
|
||||
setVel pt = pt & ptVel .+.+~ acc
|
||||
|
||||
turnBulAt
|
||||
:: Maybe Int -- ^ Pass-through creature id
|
||||
-> Color
|
||||
-> Point2 -- ^ Start position
|
||||
-> Point2 -- ^ Velocity
|
||||
-> Point2 -- ^ Acceleration
|
||||
-> HitEffect
|
||||
-> Float -- ^ Bullet width
|
||||
-> Point2 -- ^ Target position
|
||||
-> Particle
|
||||
turnBulAt maycid col pos vel acc hiteff width tpos = BulletPt
|
||||
{ _ptDraw = drawBul
|
||||
, _ptUpdate = \w -> mvBullet w . setVel
|
||||
, _ptVel = vel
|
||||
, _btDrag = 1
|
||||
, _ptColor = col
|
||||
, _ptTrail = [pos]
|
||||
, _ptCrIgnore = maycid
|
||||
, _ptWidth = width
|
||||
, _ptTimer = 100
|
||||
, _ptHitEff = hiteff
|
||||
}
|
||||
where
|
||||
setVel pt = pt & ptVel %~ vecTurnTo 0.1 (head $ _ptTrail pt) tpos
|
||||
|
||||
Reference in New Issue
Block a user