Skip to content

Commit

Permalink
()
Browse files Browse the repository at this point in the history
  • Loading branch information
gugushall committed Jan 27, 2023
1 parent a267800 commit 8b2620b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,43 +75,43 @@ SoundJS.addBatch([

bgImg.src = 'bg.png';
bgImg.name = 'bg';
bgImg.onload = loadGfx;
bgImg.onload = loadGfx();

mainImg.src = 'main.png';
mainImg.name = 'main';
mainImg.onload = loadGfx;
mainImg.onload = loadGfx();

startBImg.src = 'startB.png';
startBImg.name = 'startB';
startBImg.onload = loadGfx;
startBImg.onload = loadGfx();

creditsBImg.src = 'creditsB.png';
creditsBImg.name = 'creditsB';
creditsBImg.onload = loadGfx;
creditsBImg.onload = loadGfx();

creditsViewImg.src = 'credits.png';
creditsViewImg.name = 'credits';
creditsViewImg.onload = loadGfx;
creditsViewImg.onload = loadGfx();

playerImg.src = 'paddle.png';
playerImg.name = 'player';
playerImg.onload = loadGfx;
playerImg.onload = loadGfx();

ballImg.src = 'ball.png';
ballImg.name = 'ball';
ballImg.onload = loadGfx;
ballImg.onload = loadGfx();

cpuImg.src = 'paddle.png';
cpuImg.name = 'cpu';
cpuImg.onload = loadGfx;
cpuImg.onload = loadGfx();

winImg.src = 'win.png';
winImg.name = 'win';
winImg.onload = loadGfx;
winImg.onload = loadGfx();

loseImg.src = 'lose.png';
loseImg.name = 'lose';
loseImg.onload = loadGfx;
loseImg.onload = loadGfx();

/* Ticker */

Expand Down Expand Up @@ -156,8 +156,8 @@ function addTitleView()
stage.update();


startB.onPress = addGameView;
creditsB.onPress = showCredits;
startB.onPress = addGameView();
creditsB.onPress = showCredits();
}


Expand All @@ -170,7 +170,7 @@ function showCredits()
stage.addChild(credits);
stage.update();
Tween.get(credits).to({x:0}, 300);
credits.onPress = hideCredits;
credits.onPress = hideCredits();
}


Expand All @@ -179,7 +179,7 @@ function showCredits()

function hideCredits(e)
{
Tween.get(credits).to({x:480}, 300).call(rmvCredits);
Tween.get(credits).to({x:480}, 300).call(rmvCredits());
}

// Remove Credits
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<script src="sound.js"></script>
<script src="Main.js"></script>
</head>
<body onload="Main();">
<body onload="Main()">

<canvas id="Pong" width="480" height="320"></canvas>

Expand Down

1 comment on commit 8b2620b

@vercel
Copy link

@vercel vercel bot commented on 8b2620b Jan 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.