Fix jetpack

This commit is contained in:
jgk
2021-04-24 20:24:33 +02:00
parent 71795d2d9d
commit 24ea24cd6d
3 changed files with 12 additions and 3 deletions
+8 -3
View File
@@ -237,7 +237,10 @@ goalPict cr = let r = _crRad cr in case _crState cr of
_ -> dGoals $ sizeColEnemy r magenta
where dGoals p = pictures [p, rotate (0 - _crDir cr) $ scale 0.1 0.1 $ color white $ text $ show gls]
_ -> sizeColEnemy r (light $ dim green)
{-
The creature you control.
ID 0.
-}
startCr :: Creature
startCr = defaultCreature
{ _crPos = (0,0)
@@ -253,10 +256,12 @@ startCr = defaultCreature
, _crInv = startInventory
, _crCorpse = onLayer CorpseLayer $ color (greyN 0.5) $ pictures [color (greyN 0.8) $ circleSolid 10, circLine 10]
}
{-
Items you start with.
-}
startInventory = IM.fromList (zip [0..20]
(
[ jetPack
[
--[pistol
--,blinkGun
--,spawnGun lamp
+3
View File
@@ -60,14 +60,17 @@ wasdWithAiming w speed aimSpeed i cr
= stepForward' aimSpeed
$ over crPos (+.+ (aimSpeed *.* mov))
$ set crDir mouseDir
$ set (crState . stance . carriage) (Walking 0 0)
cr
| isMoving
= stepForward' speed
$ over ( crPos) (+.+ (speed *.* mov))
$ over ( crDir) (flip fromMaybe dir)
$ set (crState . stance . carriage) (Walking 0 0)
cr
| otherwise
= over ( crDir) (flip fromMaybe dir)
$ set (crState . stance . carriage) Standing
cr
where
(mov',dir') = wasdComp (view keys w) w
+1
View File
@@ -232,6 +232,7 @@ data Stance = Stance
deriving (Eq,Show)
data Carriage
= Walking { _stepCycle :: Int, _stepToAdd :: Int }
| Standing
| Floating
| Boosting Point2
deriving (Eq,Show)