Browse Search Popular Register Upload Rules User list Login:
Search:
Pac - Man

Image:
screenshot of the scene

Author: PrimeChase

Group: Default

Filesize: 144.13 kB

Date added: 2019-12-27

Rating: 5

Downloads: 4977

Views: 499

Comments: 6

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Using the arrow keys to move, eat white dots and big yellow dots in order to reach at least 18,400 points and win! Be aware ghosts will try to find you...
---Version 2.0 (Special thanks to Xray)---
---Additions---
New part: Score
-Each white dot is worth 100 points
-Replaced with "Final Score" on hit by ghost
New part: Lives
-Unfinished, subject to removal at any time without warning
-Replaced with "Game Over" on hit by ghost
New part: Big yellow dots (4)
-These dots give you 150 points instead of the usual 100
---Others---
-Ghosts now start in ghost house
-Ghosts dissapear if at least 18,400 points reached
-Old description in game
---Version 2.1---
---Part updates---
-Big yellow dots now lock ghosts in ghost house when touched, effect is stackable, timer is shown when effect is active, no power-up sign shown otherwise
---Additions---
New part: Cherry
-Collectable at score 15,000
-Awards 200 points when collected
-Sign at top left corner of map telling if Cherry is collectable at the moment
---Removed---
Lives
-Might return at later date
---version 2.2---
---Returning---
Returning part: Livs
-Might update on occasion
-Replaced with "Game Over" when lives = 0
---Others---
-Kinda broke Blinky when trying to restore work progress, fixed now
-Planning to make second maze, with hazards
-Also planning Ghost - Man edition
Last edited at 2020/06/07 22:25:05 by PrimeChase
Please log in to rate this scene
edit
Nice job on the game! :tup: Next, maybe you can make a scoring system for it? :)
I don't know, Xray. I'm kinda not good with scripts... but I can TRY!
Nice improvements you made! :tup:

You can get rid of the score and the lives displaying "undefined" when the scene is first loaded by initializing those variables each time the scene gets loaded. You do that in "onSpawn". An example would be:

onSpawn = (e)=> { scene.my._MRB = 0; scene.my._PAC = 1}

Because those are global (scene.my) variables, you can initialize them in ANY object. Local variables (those variables which begin with an underscore, such as _var) must be initialized within the object where they are stored and used. The underscore character that you use in global variables is not necessary.

Hope this helps.
Last edited at 2020/05/19 05:50:05 by Xray
Score still shows "undefined" when the scene gets loaded.
I noticed that the PacMan character bounces around like a helium balloon, and he never points in the proper direction in which he is travelling. Well, I have a fix for that. PacMan is made up of two polygons, and so you can put the same script in both polygons at the same time like this. Select both polygons, and then open the "script menu". You should see a total of two polygons. In the script menu, add (copy and paste) the following script to "postStep":

keys.isDown("up") ? {
angle = {1.65}
} : {};
keys.isDown("down") ? {
angle = {-1.4}
} : {};
keys.isDown("left") ? {
angle = {3.3}
} : {};
keys.isDown("right") ? {
angle = {0.0}
} : {}

What that does is it makes pacMan face in the correct direction when any one of the four arrow keys is pressed.

EDIT: By the way, those numbers for the angular directions are not what they should be, and that is because of the fact that the pacMan texture does not "fit" correctly on the polygons. If it did fit correctly then the numbers would be multiples of pi (such as pi/2 and 2pi). So instead of pi/2 (which is 1.57) I had to use 1.65. And for pi (3.14) I had to use 3.3. That's why I had to use those oddball numbers. :lol:

I could also show you how to make PacMan open and close his mouth as he moves, but that requires a lot more complexity, and I don't think that you will want to spend a lot of time and effort to do that right now. So, maybe some time later.... :)
Last edited at 2020/06/08 05:48:48 by Xray
I see that you got rid of one of the pacMan polygons. GOOD! Now you need only one to worry about! The instructions to make him point in the correct directions are exactly the same as before except you only need to add the script to ONE polygon instead of two. :tup: