add charge field to player
This commit is contained in:
@@ -36,6 +36,7 @@ sig
|
|||||||
, y: int
|
, y: int
|
||||||
, jumpPressed: bool
|
, jumpPressed: bool
|
||||||
, enemies: defeated_enemies vector
|
, enemies: defeated_enemies vector
|
||||||
|
, charge: int
|
||||||
}
|
}
|
||||||
|
|
||||||
datatype player_patch =
|
datatype player_patch =
|
||||||
@@ -106,6 +107,7 @@ struct
|
|||||||
, y: int
|
, y: int
|
||||||
, jumpPressed: bool
|
, jumpPressed: bool
|
||||||
, enemies: defeated_enemies vector
|
, enemies: defeated_enemies vector
|
||||||
|
, charge: int
|
||||||
}
|
}
|
||||||
|
|
||||||
datatype player_patch =
|
datatype player_patch =
|
||||||
@@ -149,6 +151,7 @@ struct
|
|||||||
, y = 500
|
, y = 500
|
||||||
, jumpPressed = false
|
, jumpPressed = false
|
||||||
, enemies = Vector.fromList []
|
, enemies = Vector.fromList []
|
||||||
|
, charge = 60
|
||||||
}
|
}
|
||||||
|
|
||||||
val wall1 = {id = 1, x = 0, y = 0, width = 100, height = 1080}
|
val wall1 = {id = 1, x = 0, y = 0, width = 100, height = 1080}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
) =
|
) =
|
||||||
{ yAxis = yAxis
|
{ yAxis = yAxis
|
||||||
, xAxis = xAxis
|
, xAxis = xAxis
|
||||||
@@ -28,6 +29,7 @@ struct
|
|||||||
, y = y
|
, y = y
|
||||||
, jumpPressed = jumpPressed
|
, jumpPressed = jumpPressed
|
||||||
, enemies = enemies
|
, enemies = enemies
|
||||||
|
, charge = charge
|
||||||
}
|
}
|
||||||
|
|
||||||
fun withPatch (player: player, patch) =
|
fun withPatch (player: player, patch) =
|
||||||
@@ -45,6 +47,7 @@ struct
|
|||||||
, y
|
, y
|
||||||
, jumpPressed
|
, jumpPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
} = player
|
} = player
|
||||||
in
|
in
|
||||||
case patch of
|
case patch of
|
||||||
@@ -62,6 +65,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_Y_AXIS yAxis =>
|
| W_Y_AXIS yAxis =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -77,6 +81,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_RECOIL recoil =>
|
| W_RECOIL recoil =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -92,6 +97,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_ATTACKED attacked =>
|
| W_ATTACKED attacked =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -107,6 +113,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_MAIN_ATTACK mainAttack =>
|
| W_MAIN_ATTACK mainAttack =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -122,6 +129,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_FACING facing =>
|
| W_FACING facing =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -137,6 +145,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_HEALTH health =>
|
| W_HEALTH health =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -152,6 +161,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_X x =>
|
| W_X x =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -167,6 +177,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_Y y =>
|
| W_Y y =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -182,6 +193,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_JUMP_PRESSED jumpPressed =>
|
| W_JUMP_PRESSED jumpPressed =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -197,6 +209,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_MAIN_ATTACK_PRESSED mainAttackPressed =>
|
| W_MAIN_ATTACK_PRESSED mainAttackPressed =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -212,6 +225,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
| W_ENEMIES enemies =>
|
| W_ENEMIES enemies =>
|
||||||
mkPlayer
|
mkPlayer
|
||||||
@@ -227,6 +241,7 @@ struct
|
|||||||
, facing
|
, facing
|
||||||
, mainAttackPressed
|
, mainAttackPressed
|
||||||
, enemies
|
, enemies
|
||||||
|
, charge
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -254,6 +269,7 @@ struct
|
|||||||
val recoilLimit = 15
|
val recoilLimit = 15
|
||||||
val attackedLimit = 55
|
val attackedLimit = 55
|
||||||
val mainAttackLimit = 15
|
val mainAttackLimit = 15
|
||||||
|
val maxCharge = 60
|
||||||
|
|
||||||
(* helper functions checking input *)
|
(* helper functions checking input *)
|
||||||
fun getXAxis (lh, rh) =
|
fun getXAxis (lh, rh) =
|
||||||
|
|||||||
Reference in New Issue
Block a user