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