5 ms·
Pacman in HTML5 / Canvas
- dinde 16y agoCool. The ghosts aren't very intelligent. :)
- daleharvey 16y agoheh - http://github.com/daleharvey/pacman/blob/master/pacman.js#L219 http://github.com/daleharvey/pacman/blob/master/pacman.js#L2... I didnt realise the ghosts has fairly complicated strategy, should be fun to implement now the mechanics are mostly done.
- Batsu 16y agoI was just barely working on a pacman clone about two months ago... turned into mostly just research. It turns out the ghosts follow rather simple patterns between two modes (spread out / attack) which turn into complex behavior, mostly due to how they interact with each other. I found this thread very helpful for the Ghost AI: http://www.atariage.com/forums/topic/68707-pac-man-ghost-ai-question/page__p__845359 http://www.atariage.com/forums/topic/68707-pac-man-ghost-ai-...
- daleharvey 16y agothanks http://home.comcast.net/~jpittman2/pacman/pacmandossier.html http://home.comcast.net/~jpittman2/pacman/pacmandossier.html was the best guide I found, its brilliantly in depth and covers more behaviour than I ever realised, like how the pacman turns corners. Pity I only found it after I mostly finished it.
- Kilimanjaro 16y agoI would like to see a pacman in svg for comparison purposes.
- simcop2387 16y agoSeems to have a small bug, dead ghosts that are on their way back to the middle to be reborn can kill you while you are still able to eat the other ghosts.
- daleharvey 16y agoThey dont go back to the middle at all, they just wander around quickly for a few seconds then turn back. I havent implemented the proper behaviour for ghosts yet, I just wanted to publish this now as it was mostly about the html5 issues, I can do the proper behaviour later.
- simcop2387 16y agoAh that explains it, good to know that its currently as intended :)
- hngryhppos 16y agoIs there a way to turn the sound off? I couldn't find a way.
- hngryhppos 16y agoIs there a way to turn the sound off? I couldn't find a way.
- sxtxixtxcxh 16y agoIt complains in Safari 5 and the WebKit nightly build that I need a better browser.
- daleharvey 16y agoyeh I was quite surprised that safari failed the test to play audio, usually when stuff works in chrome its ok in safari, I assume its some silly mistake on my end but as far as I can tell, safari doesnt support ogg audio at least.
- michaeltwofish 16y agoThat's right, Safari doesn't support Ogg. See http://diveintohtml5.org/video.html#what-works http://diveintohtml5.org/video.html#what-works.
- _maxime 16y agoSafari support has been added in a fork http://github.com/jpld/pacman http://github.com/jpld/pacman
- th0ma5 16y agoso the google one was what, flash?
- spcmnspff 16y agojavascript, I believe. http://github.com/macek/google_pacman/tree/master/src/js http://github.com/macek/google_pacman/tree/master/src/js
- shirtless_coder 16y agoThat was one of the more difficult pacman implementations I've played.
- Optikal 16y agopacman_util.js is missing from your tree, and I don't see anywhere mentioning what it might be,.
- bugmenot 16y agoIt produces an uncaught Security error" code: "1000 [sic weird quotes] in Firefox when the Firefox pref dom.storage.enabled is set to false. Here's how to catch it: http://github.com/stepahn/Modernizr/commit/6ab14fff80c8e1c01250ee0b5c7be594c14cb0f6 http://github.com/stepahn/Modernizr/commit/6ab14fff80c8e1c01...
- ithkuil 16y agoIt says: Sorry, needs a decent browser: (firefox 3.6+, Chrome 4+, Opera 10+ and Safari 4+) But I run "Chromium 6.0.484.0 (54673) Ubuntu 10.04". I feel that it would work perfectly on chromium 6, and you are a little bit too strict in your user agent check :-)