Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bonus length increased + pacman is faster during bonus

  • Loading branch information...
commit c063b85ea3d169c9b1218084a585a68ec91c18c9 1 parent b3f7642
@HenJi HenJi authored
View
4 src/default.opa
@@ -87,7 +87,7 @@ Default = {{
|> _.f2
pacman = {
- base = Base.make(13, 16, {right}, 10)
+ base = Base.make(13, 16, {right}, pacman_speed)
next_dir = {right}
mouth_step = 0
mouth_incr = 1
@@ -97,7 +97,7 @@ Default = {{
@private make_ghost(ai, prison, color, eye_color) =
~{x y} = Set.random_get(ghost_prison) |> Option.get
{ ~ai ~color ~eye_color
- base = Base.make(x, y, {up}, 11)
+ base = Base.make(x, y, {up}, ghosts_speed)
prison = some(prison)
eye_step = 0
eye_steps = 32
View
10 src/food.opa
@@ -1,14 +1,17 @@
@client Food = {{
check(pos, food, cur_steroids) =
+ speed =
+ if Option.is_none(cur_steroids) then pacman_speed
+ else pacman_speed_on_steroids
match Map.extract(pos, food) with
- | (food, {none}) -> (food, 0, cur_steroids)
+ | (food, {none}) -> (food, 0, cur_steroids, speed)
| (food, {some=f}) ->
(food, d) =
if food == Map.empty then (Default.food, clear_bonus)
else (food, 0)
match f with
- | {normal} -> (food, food_points+d, cur_steroids)
+ | {normal} -> (food, food_points+d, cur_steroids, speed)
| {steroids} ->
new_steroids = match cur_steroids with
| {none} ->
@@ -17,7 +20,8 @@
| {some=s} ->
{cycles = s.cycles+steroid_len
combo = s.combo}
- (food, steroid_points+d, some(new_steroids))
+ (food, steroid_points+d,
+ some(new_steroids), pacman_speed_on_steroids)
draw(g, ctx:Canvas.context) =
food = g.food
View
5 src/opacman.opa
@@ -10,10 +10,13 @@ info_width = 250
food_points = 10
steroid_points = 100
-steroid_len = 5*fps /* frames */
+steroid_len = 6*fps /* frames */
clear_bonus = 500
life_points = 2500
+pacman_speed = 10
+pacman_speed_on_steroids = 8
+ghosts_speed = 11
/* Defaults */
View
7 src/pacman.opa
@@ -71,8 +71,9 @@
y = mod(grid_heigth + p.base.pos.y + dy, grid_heigth)
}
- (food, dscore, steroids) =
- if cur_step != p.base.max_steps/4 then (g.food, 0, g.on_steroids)
+ (food, dscore, steroids, max_steps) =
+ if cur_step != p.base.max_steps/4 then
+ (g.food, 0, g.on_steroids, p.base.max_steps)
else Food.check(pos, g.food, g.on_steroids)
score = g.score + dscore
lives = g.lives + (score/life_points - g.score/life_points)
@@ -89,7 +90,7 @@
{ p with
mouth_step = mouth
mouth_incr = dmouth
- base = { p.base with ~pos ~dir ~cur_step } }
+ base = { p.base with ~pos ~dir ~cur_step ~max_steps} }
{g with ~pacman ~food ~score ~lives ~on_steroids}
}}
Please sign in to comment.
Something went wrong with that request. Please try again.