Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Fixed Healthbar #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/instructions.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

function instructions()
{
var colorCheck;
Expand Down
8 changes: 6 additions & 2 deletions scripts/levels.js
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,8 @@ function drawGUI()
else gameArena.drawImage(life1, midx+(280-2)*(width/1220), midy-305*(width/1220));
}

if(eh >= 2.0) { // for making the yellow color life line of enemytriangle
//creates healthbare for enemy ship.
if(eh >= 2.0) {
gameArena.shadowBlur = 50;
gameArena.shadowColor = "#21E821";
gameArena.beginPath();
Expand All @@ -1375,14 +1376,16 @@ function drawGUI()
gameArena.arc(ex+(30+50*(eh/100.0))*(width/1220), ey-5*(width/1220), 2*(width/1220), 0, 2*Math.PI);
gameArena.fill();
}

//Creates the circular healthbar for your Space Ship.
for(var i = 0;i < ss.length;i++) {
if(ss[i].fh >= 2.0) {
gameArena.shadowBlur = 50;
gameArena.shadowColor = "#21E821";
gameArena.beginPath();
gameArena.lineWidth = 4;
gameArena.strokeStyle = "#21E821";
gameArena.arc(ss[i].x+(30+20+20)*(width/1220),ss[i].y-15*(width/1220)+100,90,0,2*Math.PI*(ss[i].fh/100));
gameArena.arc(ss[i].x+(30+20+28)*(width/1220),ss[i].y-15*(width/1220)+98,90,0,2*Math.PI*(ss[i].fh/100));
gameArena.stroke();
if(ss[i].fh<99) {
gameArena.beginPath();
Expand Down Expand Up @@ -2116,6 +2119,7 @@ function intersection1(rayX, rayY, rayTheta)
}
}


function Level_click()
{
if(!enemyDestroyed && !gameOver && !GC)
Expand Down