mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 21:31:39 -05:00
life
This commit is contained in:
@@ -54,7 +54,7 @@ function startGame() {
|
||||
for (var i = 1; i <= playerCount; i++) {
|
||||
if (playerList[i - 1].canvas.customVarMouseDown != "false") {
|
||||
playerList[i - 1].canvas.customVarMouseDelay += 1
|
||||
if (playerList[i - 1].canvas.customVarMouseDelay > 5 || playerList[i - 1].canvas.customVarMouseDelay == 1) {
|
||||
if (playerList[i - 1].canvas.customVarMouseDelay > 5) {
|
||||
if (playerList[i - 1].canvas.customVarMouseDown == "up") {
|
||||
playerList[i - 1].life += 1
|
||||
} else {
|
||||
@@ -119,7 +119,6 @@ function configurePlayerBox(playerBoxID) {
|
||||
currentPlayer.canvas.height = rowHeight
|
||||
context.translate(currentPlayer.canvas.width / 2, currentPlayer.canvas.height / 2)
|
||||
context.rotate(Math.PI / 180 * currentPlayer.rotation)
|
||||
// drawPlayerBox(context, 0, 0)
|
||||
}
|
||||
function mouseDownPlayerBox(canvas, clickX = 0, clickY = 0) {
|
||||
if (clickX > 0 && clickY > 0) {
|
||||
@@ -127,26 +126,34 @@ function mouseDownPlayerBox(canvas, clickX = 0, clickY = 0) {
|
||||
if (playerList[canvas.customVarID - 1].rotation == 0) {
|
||||
if (clickX > playerBoxBounds.width / 2 + playerBoxBounds.x) {
|
||||
canvas.customVarMouseDown = "up"
|
||||
playerList[canvas.customVarID - 1].life += 1
|
||||
} else {
|
||||
canvas.customVarMouseDown = "down"
|
||||
playerList[canvas.customVarID - 1].life -= 1
|
||||
}
|
||||
} else if (playerList[canvas.customVarID - 1].rotation == 90) {
|
||||
if (clickY > playerBoxBounds.height / 2 + playerBoxBounds.y) {
|
||||
canvas.customVarMouseDown = "up"
|
||||
playerList[canvas.customVarID - 1].life += 1
|
||||
} else {
|
||||
canvas.customVarMouseDown = "down"
|
||||
playerList[canvas.customVarID - 1].life -= 1
|
||||
}
|
||||
} else if (playerList[canvas.customVarID - 1].rotation == 180) {
|
||||
if (clickX > playerBoxBounds.width / 2 + playerBoxBounds.x) {
|
||||
canvas.customVarMouseDown = "down"
|
||||
playerList[canvas.customVarID - 1].life -= 1
|
||||
} else {
|
||||
canvas.customVarMouseDown = "up"
|
||||
playerList[canvas.customVarID - 1].life += 1
|
||||
}
|
||||
} else {
|
||||
if (clickY > playerBoxBounds.height / 2 + playerBoxBounds.y) {
|
||||
canvas.customVarMouseDown = "down"
|
||||
playerList[canvas.customVarID - 1].life -= 1
|
||||
} else {
|
||||
canvas.customVarMouseDown = "up"
|
||||
playerList[canvas.customVarID - 1].life += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<meta name="theme-color" content="#64ca2f">
|
||||
<!-- Other things -->
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="viewport" content="minimal-ui, width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<!-- Here's the stuff that does things? -->
|
||||
<script type='application/ld+json'>
|
||||
{
|
||||
@@ -127,6 +127,9 @@
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
@viewport {
|
||||
orientation: portrait;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user