test pacman

This commit is contained in:
hexahigh 2023-04-08 01:39:49 +02:00
parent ff8d054639
commit 7380f8eb44
3 changed files with 14 additions and 15 deletions

View File

@ -51,21 +51,6 @@
<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="js/jquery.hammer.min.js" type="text/javascript"></script>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-28993174-1']);
_gaq.push(['_setDomainName', 'pacman.platzh1rsch.ch']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>

View File

View File

@ -158,6 +158,20 @@ function geronimo() {
// Manages the whole game ("God Object")
function Game() {
this.cheatHealth = function () {
this.score.set(0);
this.score.refresh(".score");
pacman.lives = 100;
this.refreshLevel(".level");
this.pause = false;
this.gameOver = false;
};
this.cheatHealth();
this.timer = new Timer(); // TODO: implememnt properly, and submit with highscore
this.refreshRate = 33; // speed of the game, will increase in higher levels