rub-pacman 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +32 -0
- data/Rakefile +1 -0
- data/bin/pacman +6 -0
- data/lib/pacman.rb +17 -0
- data/lib/pacman/Block.rb +15 -0
- data/lib/pacman/Coordinate.rb +39 -0
- data/lib/pacman/Cyan.rb +38 -0
- data/lib/pacman/Game.rb +110 -0
- data/lib/pacman/GameObject.rb +28 -0
- data/lib/pacman/GameWindow.rb +81 -0
- data/lib/pacman/Orange.rb +27 -0
- data/lib/pacman/Pink.rb +25 -0
- data/lib/pacman/Player.rb +200 -0
- data/lib/pacman/Point.rb +15 -0
- data/lib/pacman/Red.rb +177 -0
- data/lib/pacman/Screen.rb +46 -0
- data/lib/pacman/version.rb +3 -0
- data/lvl.txt +36 -0
- data/media/Beep.wav +0 -0
- data/media/Intro.ogg +0 -0
- data/media/Intro.wav +0 -0
- data/media/block.png +0 -0
- data/media/block3.png +0 -0
- data/media/cyan.png +0 -0
- data/media/orange.png +0 -0
- data/media/pacman-l.png +0 -0
- data/media/pacman.png +0 -0
- data/media/pacman3.png +0 -0
- data/media/pacman_anim.png +0 -0
- data/media/pacman_anim2.png +0 -0
- data/media/pink.png +0 -0
- data/media/point.png +0 -0
- data/media/red.png +0 -0
- data/media/red3.png +0 -0
- data/pacman.gemspec +25 -0
- metadata +150 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 TODO: Write your name
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Pacman
|
2
|
+
|
3
|
+
Game based on pacman using gosu.
|
4
|
+
|
5
|
+
Windows executable: https://dl.dropboxusercontent.com/u/54612379/pacman.rar
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'pacman'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install pacman
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Run it:
|
24
|
+
$ pacman
|
25
|
+
|
26
|
+
## Contributing
|
27
|
+
|
28
|
+
1. Fork it ( http://github.com/<my-github-username>/pacman/fork )
|
29
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
30
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
31
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
32
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/pacman
ADDED
data/lib/pacman.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Pacman package
|
2
|
+
module Pacman
|
3
|
+
require_relative "pacman/version"
|
4
|
+
require_relative 'pacman/GameWindow.rb'
|
5
|
+
require_relative 'pacman/Game.rb'
|
6
|
+
require_relative 'pacman/GameObject.rb'
|
7
|
+
require_relative 'pacman/Block.rb'
|
8
|
+
require_relative 'pacman/Player.rb'
|
9
|
+
require_relative 'pacman/Point.rb'
|
10
|
+
require_relative 'pacman/Screen.rb'
|
11
|
+
require_relative 'pacman/Red.rb'
|
12
|
+
require_relative 'pacman/Pink.rb'
|
13
|
+
require_relative 'pacman/Orange.rb'
|
14
|
+
require_relative 'pacman/Cyan.rb'
|
15
|
+
require_relative 'pacman/Coordinate.rb'
|
16
|
+
ROOT_PATH = File.dirname(File.dirname(__FILE__)) + '/'
|
17
|
+
end
|
data/lib/pacman/Block.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Wall in maze
|
4
|
+
class Block < GameObject
|
5
|
+
def initialize(window)
|
6
|
+
path = ROOT_PATH + '/media/block.png'
|
7
|
+
@image = Gosu::Image.new(window, path, false)
|
8
|
+
@x = @y = 0.0
|
9
|
+
end
|
10
|
+
|
11
|
+
def draw
|
12
|
+
@image.draw_rot(@x, @y, 1, 0) # draw_rot bere stred obrazku
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Represent position in grid
|
4
|
+
class Coordinate
|
5
|
+
attr_accessor :x, :y
|
6
|
+
def initialize(x, y)
|
7
|
+
@x = x
|
8
|
+
@y = y
|
9
|
+
end
|
10
|
+
|
11
|
+
def neighbor(direction)
|
12
|
+
x = @x
|
13
|
+
y = @y
|
14
|
+
x -= 1 if direction == LEFT
|
15
|
+
x += 1 if direction == RIGHT
|
16
|
+
y -= 1 if direction == UP
|
17
|
+
y += 1 if direction == DOWN
|
18
|
+
|
19
|
+
Coordinate.new(x, y)
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_direction(coord)
|
23
|
+
res = UNDEF
|
24
|
+
|
25
|
+
res = LEFT if @x > coord.x
|
26
|
+
res = RIGHT if @x < coord.x
|
27
|
+
res = UP if @y > coord.y
|
28
|
+
res = DOWN if @y < coord.y
|
29
|
+
res
|
30
|
+
end
|
31
|
+
|
32
|
+
# manhatan
|
33
|
+
def distance(coord)
|
34
|
+
x = @x - coord.x
|
35
|
+
y = @y - coord.y
|
36
|
+
x.abs + y.abs
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/pacman/Cyan.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Cyan ghost
|
4
|
+
class Cyan < Red
|
5
|
+
def initialize(window)
|
6
|
+
path = ROOT_PATH + '/media/cyan.png'
|
7
|
+
@image = Gosu::Image.new(window, path, false)
|
8
|
+
@x = @y = @vel_x = @vel_y = @angle = 0.0
|
9
|
+
@speed = 1.35
|
10
|
+
@direction = LEFT
|
11
|
+
@enter_field = true
|
12
|
+
@pass_center = false
|
13
|
+
@vel_x = -@speed
|
14
|
+
@scatter_target = Coordinate.new(GRIDX - 3, GRIDY - 3)
|
15
|
+
@timer = 0
|
16
|
+
@state = SCATTER
|
17
|
+
end
|
18
|
+
|
19
|
+
def get_red(ghosts)
|
20
|
+
for i in 0..ghosts.length
|
21
|
+
if ghosts[i].class == Red
|
22
|
+
res = ghosts[i]
|
23
|
+
break
|
24
|
+
end
|
25
|
+
end
|
26
|
+
res
|
27
|
+
end
|
28
|
+
|
29
|
+
def set_target(grid, player, ghosts)
|
30
|
+
red = get_red(ghosts).grid_pos
|
31
|
+
@target = player.grid_pos.neighbor(player.get_direction)
|
32
|
+
@target = @target.neighbor(player.get_direction)
|
33
|
+
offset_x = @target.x - red.x
|
34
|
+
offset_y = @target.y - red.y
|
35
|
+
@target = Coordinate.new(@target.x + offset_x, @target.y + offset_y)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/pacman/Game.rb
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# define usual constants
|
3
|
+
module Pacman
|
4
|
+
LEFT = 0
|
5
|
+
UP = 1
|
6
|
+
RIGHT = 2
|
7
|
+
DOWN = 3
|
8
|
+
UNDEF = 5
|
9
|
+
|
10
|
+
GRIDX = 28
|
11
|
+
GRIDY = 36
|
12
|
+
|
13
|
+
BLOCK_SIZE = 16
|
14
|
+
BLOCK_HSIZE = 8
|
15
|
+
# Represent game model
|
16
|
+
class Game
|
17
|
+
attr_accessor :player, :points, :score, :grid, :ghosts, :win, :lose
|
18
|
+
|
19
|
+
def axis_val(x)
|
20
|
+
BLOCK_SIZE * x + BLOCK_HSIZE
|
21
|
+
end
|
22
|
+
|
23
|
+
def load_map(window, map)
|
24
|
+
map.each_with_index do
|
25
|
+
|row, y| row.each_with_index do
|
26
|
+
|col, x|
|
27
|
+
case col
|
28
|
+
when 's'
|
29
|
+
@grid[x][y] = @player
|
30
|
+
@player.warp(axis_val(x), axis_val(y))
|
31
|
+
when 'x'
|
32
|
+
@grid[x][y] = Block.new(window)
|
33
|
+
@grid[x][y].warp(axis_val(x), axis_val(y))
|
34
|
+
when 'p'
|
35
|
+
point = Point.new(window)
|
36
|
+
@grid[x][y] = point
|
37
|
+
@grid[x][y].warp(axis_val(x), axis_val(y))
|
38
|
+
@points.push(point)
|
39
|
+
when 'r'
|
40
|
+
ghost = Red.new(window)
|
41
|
+
ghosts.push(ghost)
|
42
|
+
@grid[x][y] = ghost
|
43
|
+
@grid[x][y].warp(axis_val(x), axis_val(y))
|
44
|
+
when 'i'
|
45
|
+
ghost = Pink.new(window)
|
46
|
+
ghosts.push(ghost)
|
47
|
+
@grid[x][y] = ghost
|
48
|
+
@grid[x][y].warp(axis_val(x), axis_val(y))
|
49
|
+
when 'a'
|
50
|
+
ghost = Orange.new(window)
|
51
|
+
ghosts.push(ghost)
|
52
|
+
@grid[x][y] = ghost
|
53
|
+
@grid[x][y].warp(axis_val(x), axis_val(y))
|
54
|
+
when 'c'
|
55
|
+
ghost = Cyan.new(window)
|
56
|
+
ghosts.push(ghost)
|
57
|
+
@grid[x][y] = ghost
|
58
|
+
@grid[x][y].warp(axis_val(x), axis_val(y))
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def initialize(window)
|
65
|
+
path = ROOT_PATH + 'lvl.txt'
|
66
|
+
map = File.foreach(path).map { |line| line.split(' ') }
|
67
|
+
@player = Player.new(window)
|
68
|
+
@player.warp(320, 240)
|
69
|
+
@points = []
|
70
|
+
@ghosts = []
|
71
|
+
@score = 0
|
72
|
+
@win = false
|
73
|
+
@lose = false
|
74
|
+
@grid = Array.new(GRIDX) { Array.new(GRIDY) }
|
75
|
+
load_map(window, map)
|
76
|
+
end
|
77
|
+
|
78
|
+
def pressed_left
|
79
|
+
if @grid[(@player.grid_x - 1) % GRIDX][@player.grid_y].class != Block
|
80
|
+
@player.turn_left
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def pressed_right
|
85
|
+
if @grid[(@player.grid_x + 1) % GRIDX][@player.grid_y].class != Block
|
86
|
+
@player.turn_right
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
def pressed_up
|
91
|
+
if @grid[@player.grid_x][(@player.grid_y - 1) % GRIDY].class != Block
|
92
|
+
@player.turn_up
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def pressed_down
|
97
|
+
if @grid[@player.grid_x][(@player.grid_y + 1) % GRIDY].class != Block
|
98
|
+
@player.turn_down
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def update
|
103
|
+
@player.move(@grid, @points)
|
104
|
+
@ghosts.each { |ghost| ghost.move(@grid, @player, @ghosts) }
|
105
|
+
|
106
|
+
@win = true if @points.length == 0
|
107
|
+
@lose = true if @player.alive? == false
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Super class for game entities
|
4
|
+
class GameObject
|
5
|
+
attr_reader :x, :y
|
6
|
+
def initialize
|
7
|
+
@direction = UNDEF
|
8
|
+
@x = 0
|
9
|
+
@y = 0
|
10
|
+
end
|
11
|
+
|
12
|
+
def warp(x, y)
|
13
|
+
@x, @y = x, y
|
14
|
+
end
|
15
|
+
|
16
|
+
def grid_pos
|
17
|
+
Coordinate.new((@x / BLOCK_SIZE).floor, (@y / BLOCK_SIZE).floor)
|
18
|
+
end
|
19
|
+
|
20
|
+
def grid_x
|
21
|
+
(@x / BLOCK_SIZE).floor
|
22
|
+
end
|
23
|
+
|
24
|
+
def grid_y
|
25
|
+
(@y / BLOCK_SIZE).floor
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# pacman module
|
3
|
+
module Pacman
|
4
|
+
require 'rubygems'
|
5
|
+
require 'gosu'
|
6
|
+
# define order of rendering layers
|
7
|
+
module ZOrder
|
8
|
+
BACKGROUND, PLAYER, UI = *0..3
|
9
|
+
end
|
10
|
+
|
11
|
+
# game window implements game loop
|
12
|
+
class GameWindow < Gosu::Window
|
13
|
+
attr_reader :fps
|
14
|
+
def init_game
|
15
|
+
@game = Game.new(self)
|
16
|
+
@screen = Screen.new(self, @game)
|
17
|
+
@last_millis = Gosu.milliseconds
|
18
|
+
@fps = 0
|
19
|
+
path = ROOT_PATH + '/media/Intro.ogg'
|
20
|
+
@intro = Gosu::Sample.new(self, path)
|
21
|
+
@intro.play
|
22
|
+
@started = false
|
23
|
+
# @started = true
|
24
|
+
@count = 0
|
25
|
+
end
|
26
|
+
|
27
|
+
def initialize
|
28
|
+
super(16 * 28, 16 * 36, false, 18)
|
29
|
+
self.caption = 'Gosu Pac-man'
|
30
|
+
init_game
|
31
|
+
end
|
32
|
+
|
33
|
+
def update
|
34
|
+
if @started == true
|
35
|
+
if @game.win == false && @game.lose == false
|
36
|
+
if button_down?(Gosu::KbLeft) || button_down?(Gosu::GpLeft)
|
37
|
+
@game.pressed_left
|
38
|
+
end
|
39
|
+
if button_down?(Gosu::KbRight) || button_down?(Gosu::GpRight)
|
40
|
+
@game.pressed_right
|
41
|
+
end
|
42
|
+
if button_down?(Gosu::KbUp) || button_down?(Gosu::GpButton0)
|
43
|
+
@game.pressed_up
|
44
|
+
end
|
45
|
+
if button_down?(Gosu::KbDown) || button_down?(Gosu::GpButton0)
|
46
|
+
@game.pressed_down
|
47
|
+
end
|
48
|
+
|
49
|
+
@game.update
|
50
|
+
|
51
|
+
millis = Gosu.milliseconds
|
52
|
+
@fps = millis - @last_millis
|
53
|
+
@fps = (1000 / @fps)
|
54
|
+
@last_millis = millis
|
55
|
+
end
|
56
|
+
else
|
57
|
+
@count += 1
|
58
|
+
if @count == 260
|
59
|
+
@started = true
|
60
|
+
@count = 0
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def draw
|
66
|
+
@screen.draw
|
67
|
+
end
|
68
|
+
|
69
|
+
def button_down(id)
|
70
|
+
close if id == Gosu::KbEscape
|
71
|
+
|
72
|
+
if id == Gosu::KbReturn
|
73
|
+
init_game unless @game.win == false && @game.lose == false
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.run
|
78
|
+
new.show
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Orange ghost
|
4
|
+
class Orange < Red
|
5
|
+
def initialize(window)
|
6
|
+
path = ROOT_PATH + '/media/orange.png'
|
7
|
+
@image = Gosu::Image.new(window, path, false)
|
8
|
+
@x = @y = @vel_x = @vel_y = @angle = 0.0
|
9
|
+
@speed = 1.35
|
10
|
+
@direction = LEFT
|
11
|
+
@enter_field = true
|
12
|
+
@pass_center = false
|
13
|
+
@vel_x = -@speed
|
14
|
+
@scatter_target = Coordinate.new(3, GRIDY - 3)
|
15
|
+
@timer = 0
|
16
|
+
@state = SCATTER
|
17
|
+
end
|
18
|
+
|
19
|
+
def set_target(grid, player, ghosts)
|
20
|
+
if player.grid_pos.distance(grid_pos) > 7
|
21
|
+
@target = player.grid_pos
|
22
|
+
else
|
23
|
+
@target = @scatter_target
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/pacman/Pink.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Pink ghost
|
4
|
+
class Pink < Red
|
5
|
+
def initialize(window)
|
6
|
+
path = ROOT_PATH + '/media/pink.png'
|
7
|
+
@image = Gosu::Image.new(window, path, false)
|
8
|
+
@x = @y = @vel_x = @vel_y = @angle = 0.0
|
9
|
+
@speed = 1.35
|
10
|
+
@direction = LEFT
|
11
|
+
@enter_field = true
|
12
|
+
@pass_center = false
|
13
|
+
@vel_x = -@speed
|
14
|
+
@scatter_target = Coordinate.new(3, 3)
|
15
|
+
@timer = 0
|
16
|
+
@state = SCATTER
|
17
|
+
end
|
18
|
+
|
19
|
+
def set_target(grid, player, ghosts)
|
20
|
+
@target = player.grid_pos.neighbor(player.get_direction)
|
21
|
+
@target = @target.neighbor(player.get_direction)
|
22
|
+
@target = @target.neighbor(player.get_direction)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,200 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Player class
|
4
|
+
class Player < GameObject
|
5
|
+
attr_reader :score
|
6
|
+
def initialize(window)
|
7
|
+
# @image = Gosu::Image.new(window, "media/pacman.png", false)
|
8
|
+
path = 'media/pacman_anim.png'
|
9
|
+
path = ROOT_PATH + '/media/pacman_anim.png'
|
10
|
+
@animation = Gosu::Image.load_tiles(window, path, 26, 26, false)
|
11
|
+
@image = @animation[0]
|
12
|
+
@counter = 0
|
13
|
+
@animation_counter = 0
|
14
|
+
path = ROOT_PATH + 'media/Beep.wav'
|
15
|
+
@beep = Gosu::Sample.new(window, path)
|
16
|
+
@x = @y = @vel_x = @vel_y = @angle = 0.0
|
17
|
+
@speed = 1.37
|
18
|
+
@score = 0
|
19
|
+
@alive = true
|
20
|
+
end
|
21
|
+
|
22
|
+
def turn_left
|
23
|
+
@angle = 180
|
24
|
+
@vel_x = -@speed
|
25
|
+
@vel_y = 0
|
26
|
+
end
|
27
|
+
|
28
|
+
def turn_right
|
29
|
+
@angle = 0
|
30
|
+
@vel_x = @speed
|
31
|
+
@vel_y = 0
|
32
|
+
end
|
33
|
+
|
34
|
+
def turn_up
|
35
|
+
@angle = 270
|
36
|
+
@vel_x = 0
|
37
|
+
@vel_y = -@speed
|
38
|
+
end
|
39
|
+
|
40
|
+
def turn_down
|
41
|
+
@angle = 90
|
42
|
+
@vel_x = 0
|
43
|
+
@vel_y = @speed
|
44
|
+
end
|
45
|
+
|
46
|
+
def stop
|
47
|
+
@vel_x = 0
|
48
|
+
@vel_y = 0
|
49
|
+
end
|
50
|
+
|
51
|
+
def alive?
|
52
|
+
@alive
|
53
|
+
end
|
54
|
+
|
55
|
+
def kill!
|
56
|
+
@alive = false
|
57
|
+
end
|
58
|
+
|
59
|
+
def get_direction
|
60
|
+
case @angle
|
61
|
+
when 0
|
62
|
+
dir = RIGHT
|
63
|
+
when 180
|
64
|
+
dir = LEFT
|
65
|
+
when 270
|
66
|
+
dir = UP
|
67
|
+
else
|
68
|
+
dir = DOWN
|
69
|
+
end
|
70
|
+
dir
|
71
|
+
end
|
72
|
+
|
73
|
+
def center_x
|
74
|
+
if @x % BLOCK_SIZE != BLOCK_HSIZE
|
75
|
+
if (BLOCK_HSIZE - (@x % BLOCK_SIZE)).abs < @vel_y.abs
|
76
|
+
@x_mov = grid_x * BLOCK_SIZE + BLOCK_HSIZE
|
77
|
+
else
|
78
|
+
if @x % BLOCK_SIZE < BLOCK_HSIZE
|
79
|
+
@x_mov = @x + @vel_y.abs
|
80
|
+
else
|
81
|
+
@x_mov = @x - @vel_y.abs
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def center_y
|
88
|
+
if @y % BLOCK_SIZE != BLOCK_HSIZE
|
89
|
+
# jesltize nejsem vycentrovany
|
90
|
+
if (BLOCK_HSIZE - (@y % BLOCK_SIZE)).abs < @vel_x.abs
|
91
|
+
# pokud je rychlost vetsi nez vzdalenost tka vycentruj
|
92
|
+
@y_mov = grid_y * BLOCK_SIZE + BLOCK_HSIZE
|
93
|
+
else
|
94
|
+
# jinak o kousek poposun ke stredu horizontru
|
95
|
+
if @y % BLOCK_SIZE < BLOCK_HSIZE
|
96
|
+
@y_mov = @y + @vel_x.abs
|
97
|
+
else
|
98
|
+
@y_mov = @y - @vel_x.abs
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def move_on_x(new_grid_x, grid)
|
105
|
+
# jestlitze mi v ceste stoji blok tak mi vycentruj a zastav
|
106
|
+
if grid[new_grid_x][grid_y].class == Block
|
107
|
+
@x_mov = grid_x * BLOCK_SIZE + BLOCK_HSIZE
|
108
|
+
stop
|
109
|
+
else
|
110
|
+
center_y
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
def move_on_y(new_grid_y, grid)
|
115
|
+
if grid[grid_x][new_grid_y].class == Block
|
116
|
+
@y_mov = grid_y * BLOCK_SIZE + BLOCK_HSIZE
|
117
|
+
stop
|
118
|
+
else
|
119
|
+
center_x
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def update_pos
|
124
|
+
@x_mov = @x + @vel_x
|
125
|
+
@y_mov = @y + @vel_y
|
126
|
+
@x_mov %= BLOCK_SIZE * GRIDX
|
127
|
+
@y_mov %= BLOCK_SIZE * GRIDY
|
128
|
+
end
|
129
|
+
|
130
|
+
def move(grid, points)
|
131
|
+
update_pos
|
132
|
+
|
133
|
+
case get_direction
|
134
|
+
when RIGHT
|
135
|
+
if @x_mov % BLOCK_SIZE > BLOCK_HSIZE
|
136
|
+
move_on_x((grid_x + 1) % GRIDX, grid)
|
137
|
+
end
|
138
|
+
when LEFT
|
139
|
+
if @x_mov % BLOCK_SIZE < BLOCK_HSIZE
|
140
|
+
move_on_x((grid_x - 1) % GRIDX, grid)
|
141
|
+
end
|
142
|
+
when UP
|
143
|
+
if @y_mov % BLOCK_SIZE < BLOCK_HSIZE
|
144
|
+
move_on_y((grid_y - 1) % GRIDY, grid)
|
145
|
+
end
|
146
|
+
when DOWN
|
147
|
+
if @y_mov % BLOCK_SIZE > BLOCK_HSIZE
|
148
|
+
move_on_y((grid_y + 1) % GRIDY, grid)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
update_state(grid, points)
|
153
|
+
end
|
154
|
+
|
155
|
+
def update_state(grid, points)
|
156
|
+
oldx = grid_x
|
157
|
+
oldy = grid_y
|
158
|
+
|
159
|
+
warp(@x_mov, @y_mov)
|
160
|
+
|
161
|
+
if (oldx != grid_x) || (oldy != grid_y)
|
162
|
+
grid[oldx][oldy] = nil
|
163
|
+
grid[grid_x][grid_y] = self
|
164
|
+
collect_points(points)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
def moving?
|
169
|
+
res = false
|
170
|
+
res = true if @vel_x != 0 || @vel_y != 0
|
171
|
+
res
|
172
|
+
end
|
173
|
+
|
174
|
+
def draw
|
175
|
+
if moving? && alive?
|
176
|
+
if @counter == 5
|
177
|
+
@counter = 0
|
178
|
+
@image = @animation[@animation_counter]
|
179
|
+
@animation_counter += 1
|
180
|
+
@animation_counter %= 4
|
181
|
+
else
|
182
|
+
@counter += 1
|
183
|
+
end
|
184
|
+
end
|
185
|
+
@image.draw_rot(@x, @y, 1, @angle + 180) # draw_rot bere stred obrazku
|
186
|
+
end
|
187
|
+
|
188
|
+
def collect_points(points)
|
189
|
+
points.reject! do |point|
|
190
|
+
if point.grid_x == grid_x && point.grid_y == grid_y
|
191
|
+
@score += 1
|
192
|
+
@beep.play
|
193
|
+
true
|
194
|
+
else
|
195
|
+
false
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
data/lib/pacman/Point.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Represent eatable point
|
4
|
+
class Point < GameObject
|
5
|
+
def initialize(window)
|
6
|
+
path = ROOT_PATH + '/media/point.png'
|
7
|
+
@image = Gosu::Image.new(window, path, false)
|
8
|
+
@x = @y = 0.0
|
9
|
+
end
|
10
|
+
|
11
|
+
def draw
|
12
|
+
@image.draw_rot(@x, @y, 1, 0) # draw_rot bere stred obrazku
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/pacman/Red.rb
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Red ghost
|
4
|
+
class Red < GameObject
|
5
|
+
SCATTER = 1
|
6
|
+
CHASE = 2
|
7
|
+
AFRAID = 3
|
8
|
+
DEAD = 4
|
9
|
+
attr_reader :speed, :state
|
10
|
+
def initialize(window)
|
11
|
+
path = ROOT_PATH + '/media/red.png'
|
12
|
+
@image = Gosu::Image.new(window, path, false)
|
13
|
+
@x = @y = @vel_x = @vel_y = @angle = 0.0
|
14
|
+
@speed = 1.36
|
15
|
+
@direction = LEFT
|
16
|
+
@enter_field = true
|
17
|
+
@pass_center = false
|
18
|
+
@vel_x = -@speed
|
19
|
+
@scatter_target = Coordinate.new(GRIDX - 3, 3)
|
20
|
+
@timer = 0
|
21
|
+
@state = SCATTER
|
22
|
+
end
|
23
|
+
|
24
|
+
def draw
|
25
|
+
# draw_rot bere stred obrazku
|
26
|
+
@image.draw_rot(@x, @y, 1, @angle)
|
27
|
+
# @image.draw(@x, @y, 1, -1, 1)
|
28
|
+
end
|
29
|
+
|
30
|
+
def posible_fields(next_field, grid)
|
31
|
+
# najdi pristi volne
|
32
|
+
free_g = []
|
33
|
+
# je volno ve smeru kudy jdu?
|
34
|
+
mem = next_field.neighbor(@direction)
|
35
|
+
free_g.push(mem) if grid[mem.x][mem.y].class != Block
|
36
|
+
# je volno "vlevo"
|
37
|
+
mem = next_field.neighbor((@direction - 1) % 4)
|
38
|
+
free_g.push(mem) if grid[mem.x][mem.y].class != Block
|
39
|
+
# je volno "vpravo"
|
40
|
+
mem = next_field.neighbor((@direction + 1) % 4)
|
41
|
+
free_g.push(mem) if grid[mem.x][mem.y].class != Block
|
42
|
+
free_g
|
43
|
+
end
|
44
|
+
|
45
|
+
def change_dir(grid)
|
46
|
+
next_field = grid_pos
|
47
|
+
|
48
|
+
free_g = posible_fields(next_field, grid)
|
49
|
+
# urci nejblizsi smer k target pokud mam vic moznosti
|
50
|
+
if free_g.length == 0
|
51
|
+
# obraceni v jednosmerce
|
52
|
+
best = grid_pos.neighbor((@direction + 2) % 4)
|
53
|
+
else
|
54
|
+
best = free_g[0]
|
55
|
+
free_g.each do
|
56
|
+
|i| best = i if i.distance(@target) < best.distance(@target)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# nastavi se direction
|
61
|
+
@direction = next_field.get_direction(best)
|
62
|
+
# nastavime field=false protoze vnem jiz sme
|
63
|
+
@enter_field = false
|
64
|
+
end
|
65
|
+
|
66
|
+
def set_speed
|
67
|
+
@vel_x = 0
|
68
|
+
@vel_y = 0
|
69
|
+
@vel_x = -@speed if @direction == LEFT
|
70
|
+
@vel_x = @speed if @direction == RIGHT
|
71
|
+
@vel_y = -@speed if @direction == UP
|
72
|
+
@vel_y = @speed if @direction == DOWN
|
73
|
+
end
|
74
|
+
|
75
|
+
def get_direction
|
76
|
+
case @vel_x
|
77
|
+
when -@speed
|
78
|
+
dir = LEFT
|
79
|
+
when @speed
|
80
|
+
dir = RIGHT
|
81
|
+
end
|
82
|
+
case @vel_y
|
83
|
+
when -@speed
|
84
|
+
dir = UP
|
85
|
+
when @speed
|
86
|
+
dir = DOWN
|
87
|
+
end
|
88
|
+
dir
|
89
|
+
end
|
90
|
+
|
91
|
+
def update_grid(x_mov, y_mov, grid)
|
92
|
+
las_grid_x = grid_x
|
93
|
+
las_grid_y = grid_y
|
94
|
+
warp(x_mov, y_mov)
|
95
|
+
if las_grid_x != grid_x || las_grid_y != grid_y
|
96
|
+
grid[las_grid_x][las_grid_y] = nil
|
97
|
+
grid[grid_x][grid_y] = self
|
98
|
+
@enter_field = true
|
99
|
+
@pass_center = false
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def set_target(grid, player, ghosts)
|
104
|
+
@target = player.grid_pos
|
105
|
+
end
|
106
|
+
|
107
|
+
def kill_pacman(player)
|
108
|
+
player.kill! if grid_x == player.grid_x && grid_y == player.grid_y
|
109
|
+
end
|
110
|
+
|
111
|
+
def move(grid, player, ghosts)
|
112
|
+
@timer += 1
|
113
|
+
if @timer <= 1650 && @state == CHASE
|
114
|
+
set_target(grid, player, ghosts)
|
115
|
+
if @timer == 1650
|
116
|
+
@timer = 0
|
117
|
+
@state = SCATTER
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
if @timer <= 330 && @state == SCATTER
|
122
|
+
@target = @scatter_target
|
123
|
+
if @timer == 330
|
124
|
+
@timer = 0
|
125
|
+
@state = CHASE
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# pokud jsme vstoupili na nove policko
|
130
|
+
change_dir(grid) if @enter_field == true
|
131
|
+
|
132
|
+
# posun
|
133
|
+
x_mov = @x + @vel_x
|
134
|
+
y_mov = @y + @vel_y
|
135
|
+
# % zajisti vyjeti mimo obrazovku
|
136
|
+
x_mov %= BLOCK_SIZE * GRIDX
|
137
|
+
y_mov %= BLOCK_SIZE * GRIDY
|
138
|
+
|
139
|
+
# projedu za pulku soucasneho fieldu?
|
140
|
+
# pokud ano musim se spravne posunout a zmenit smer
|
141
|
+
if @pass_center == false
|
142
|
+
case get_direction
|
143
|
+
when LEFT
|
144
|
+
if x_mov < grid_x * BLOCK_SIZE + BLOCK_HSIZE
|
145
|
+
x_mov = grid_x * BLOCK_SIZE + BLOCK_HSIZE
|
146
|
+
set_speed
|
147
|
+
@pass_center = true
|
148
|
+
end
|
149
|
+
when RIGHT
|
150
|
+
if x_mov > grid_x * BLOCK_SIZE + BLOCK_HSIZE
|
151
|
+
x_mov = grid_x * BLOCK_SIZE + BLOCK_HSIZE
|
152
|
+
set_speed
|
153
|
+
@pass_center = true
|
154
|
+
end
|
155
|
+
when UP
|
156
|
+
if y_mov < grid_y * BLOCK_SIZE + BLOCK_HSIZE
|
157
|
+
y_mov = grid_y * BLOCK_SIZE + BLOCK_HSIZE
|
158
|
+
set_speed
|
159
|
+
@pass_center = true
|
160
|
+
end
|
161
|
+
when DOWN
|
162
|
+
if y_mov > grid_y * BLOCK_SIZE + BLOCK_HSIZE
|
163
|
+
y_mov = grid_y * BLOCK_SIZE + BLOCK_HSIZE
|
164
|
+
set_speed
|
165
|
+
@pass_center = true
|
166
|
+
end
|
167
|
+
else
|
168
|
+
p 'unknown direction of red'
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
# posuny v mrizce
|
173
|
+
update_grid(x_mov, y_mov, grid)
|
174
|
+
kill_pacman(player)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
module Pacman
|
3
|
+
# Rendering of game
|
4
|
+
class Screen
|
5
|
+
def initialize(window, game)
|
6
|
+
@game = game
|
7
|
+
@window = window
|
8
|
+
@font = Gosu::Font.new(window, Gosu.default_font_name, 20)
|
9
|
+
end
|
10
|
+
|
11
|
+
def draw_info
|
12
|
+
s = "Score: #{@game.player.score}"
|
13
|
+
@font.draw(s, 10, 10, ZOrder::UI, 1.0, 1.0, 0xffffff00)
|
14
|
+
s = "FPS: #{@window.fps}"
|
15
|
+
@font.draw(s, 120, 10, ZOrder::UI, 1.0, 1.0, 0xffffff00)
|
16
|
+
end
|
17
|
+
|
18
|
+
def draw_end
|
19
|
+
if @game.win == true
|
20
|
+
s = 'WIN'
|
21
|
+
@font.draw(s, 170, 250, ZOrder::UI, 3.0, 3.0, 0xffffff00)
|
22
|
+
end
|
23
|
+
if @game.lose == true
|
24
|
+
s = 'LOSE'
|
25
|
+
@font.draw(s, 170, 250, ZOrder::UI, 3.0, 3.0, 0xffffff00)
|
26
|
+
end
|
27
|
+
if @game.lose == true || @game.win == true
|
28
|
+
s = 'Press [Enter] for new game'
|
29
|
+
@font.draw(s, 130, 350, ZOrder::UI, 1.0, 1.0, 0xffffff00)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def draw
|
34
|
+
@game.points.each { |point| point.draw }
|
35
|
+
@game.grid.each do
|
36
|
+
|row| row.each do
|
37
|
+
|cel| cel.draw if cel.class == Block || cel.class == Point
|
38
|
+
end
|
39
|
+
end
|
40
|
+
@game.ghosts.each { |ghost| ghost.draw }
|
41
|
+
@game.player.draw
|
42
|
+
draw_info
|
43
|
+
draw_end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lvl.txt
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
o o o o o o o o o o o o o o o o o o o o o o o o o o o o
|
2
|
+
o o o o o o o o o o o o o o o o o o o o o o o o o o o o
|
3
|
+
o o o o o o o o o o o o o o o o o o o o o o o o o o o o
|
4
|
+
x x x x x x x x x x x x x x x x x x x x x x x x x x x x
|
5
|
+
x p p p p p p p p p p x o x p p p p p p p p p p p p a x
|
6
|
+
x p x x x p x x x x p x x x p x x x p x x x p x x x p x
|
7
|
+
x p x x x p x x x p p p p p p p p p p x x x p x x x p x
|
8
|
+
x p x x x p x x x p x x x x p x x x p p p p p p p p p x
|
9
|
+
x p p p p p p p p p x o o x p x o x p x x x p x x x p x
|
10
|
+
x p x x x p x x x p x o o x p x o x p x o x p p p p p x
|
11
|
+
x p x x x p x x x p x o o x p x o x p x o x p x x x x x
|
12
|
+
x p p p p p x x x p x o o x p x o x p x o x p x o o o x
|
13
|
+
x p x x x p x p p p x o o x p x o x p x o x p x o o o x
|
14
|
+
x p p p p p p p x p x o o x p x o x p x o x p x o o o x
|
15
|
+
x x p x x p x p x p x o o x p x o x p x x x p x x x x x
|
16
|
+
x x p x x p x p x p x x x x p x x x p p p p c p p p p x
|
17
|
+
x x p x x p x p x p p p p p p r p p p x x x p x x x x x
|
18
|
+
x x p x x p x p x p p x x x x x x p x x o x p x o o o x
|
19
|
+
x x p x x p p p p p p x o o o o x p x o o x p x o o o x
|
20
|
+
x x p x x p x p x x x x x x x x x p x x x x p x o o o x
|
21
|
+
x x p x x p x p x p p p p p p p p p p p p p p x x x x x
|
22
|
+
x x p x x p x p x p x x x x x x p x x x p p p p p p p x
|
23
|
+
x x p x x p x p x p x o o o o x p x o x p x x x x x p x
|
24
|
+
x x s x x p x p x p x o o o o x p x o x p x x p p p p x
|
25
|
+
x p p p p p p p x p x x o o o x p x o x p x x p x x x x
|
26
|
+
x p x x x x x p p p p x x x x x p x x x p p p p p p p x
|
27
|
+
x p x x x x x p x x p p p p p p p p p p p x p x x x p x
|
28
|
+
x p p p p x x p x x p x x x x x x x p x p x p x o x p x
|
29
|
+
x x x x p x x p x x p x x x x x x x p x p x p x o x p x
|
30
|
+
x x x x p x x p x x p p p x x p p p p x p p p x o x p x
|
31
|
+
x p p p p p p p x x x x p x x p x x x x x x p x o x p x
|
32
|
+
x p x x x x x x x x x x p x x p x x x x x x p x x x p x
|
33
|
+
x p p p p p p p p p p p p p p p p p p p i p p p p p p x
|
34
|
+
x x x x x x x x x x x x x x x x x x x x x x x x x x x x
|
35
|
+
o o o o o o o o o o o o o o o o o o o o o o o o o o o o
|
36
|
+
o o o o o o o o o o o o o o o o o o o o o o o o o o o o
|
data/media/Beep.wav
ADDED
Binary file
|
data/media/Intro.ogg
ADDED
Binary file
|
data/media/Intro.wav
ADDED
Binary file
|
data/media/block.png
ADDED
Binary file
|
data/media/block3.png
ADDED
Binary file
|
data/media/cyan.png
ADDED
Binary file
|
data/media/orange.png
ADDED
Binary file
|
data/media/pacman-l.png
ADDED
Binary file
|
data/media/pacman.png
ADDED
Binary file
|
data/media/pacman3.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/media/pink.png
ADDED
Binary file
|
data/media/point.png
ADDED
Binary file
|
data/media/red.png
ADDED
Binary file
|
data/media/red3.png
ADDED
Binary file
|
data/pacman.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'pacman/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rub-pacman"
|
8
|
+
spec.version = Pacman::VERSION
|
9
|
+
spec.authors = ["Viktor Podhajecky"]
|
10
|
+
spec.email = ["podhavik@gmail.com"]
|
11
|
+
spec.summary = %q{My variation on game pacman.}
|
12
|
+
spec.description = %q{Game based on pacman using Gosu. Ghost behavior is similar as in original game.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "gosu"
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.5"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "rspec"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,150 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rub-pacman
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Viktor Podhajecky
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gosu
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.5'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.5'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rspec
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: Game based on pacman using Gosu. Ghost behavior is similar as in original
|
79
|
+
game.
|
80
|
+
email:
|
81
|
+
- podhavik@gmail.com
|
82
|
+
executables:
|
83
|
+
- pacman
|
84
|
+
extensions: []
|
85
|
+
extra_rdoc_files: []
|
86
|
+
files:
|
87
|
+
- .gitignore
|
88
|
+
- Gemfile
|
89
|
+
- LICENSE.txt
|
90
|
+
- README.md
|
91
|
+
- Rakefile
|
92
|
+
- bin/pacman
|
93
|
+
- lib/pacman.rb
|
94
|
+
- lib/pacman/Block.rb
|
95
|
+
- lib/pacman/Coordinate.rb
|
96
|
+
- lib/pacman/Cyan.rb
|
97
|
+
- lib/pacman/Game.rb
|
98
|
+
- lib/pacman/GameObject.rb
|
99
|
+
- lib/pacman/GameWindow.rb
|
100
|
+
- lib/pacman/Orange.rb
|
101
|
+
- lib/pacman/Pink.rb
|
102
|
+
- lib/pacman/Player.rb
|
103
|
+
- lib/pacman/Point.rb
|
104
|
+
- lib/pacman/Red.rb
|
105
|
+
- lib/pacman/Screen.rb
|
106
|
+
- lib/pacman/version.rb
|
107
|
+
- lvl.txt
|
108
|
+
- media/Beep.wav
|
109
|
+
- media/Intro.ogg
|
110
|
+
- media/Intro.wav
|
111
|
+
- media/block.png
|
112
|
+
- media/block3.png
|
113
|
+
- media/cyan.png
|
114
|
+
- media/orange.png
|
115
|
+
- media/pacman-l.png
|
116
|
+
- media/pacman.png
|
117
|
+
- media/pacman3.png
|
118
|
+
- media/pacman_anim.png
|
119
|
+
- media/pacman_anim2.png
|
120
|
+
- media/pink.png
|
121
|
+
- media/point.png
|
122
|
+
- media/red.png
|
123
|
+
- media/red3.png
|
124
|
+
- pacman.gemspec
|
125
|
+
homepage: ''
|
126
|
+
licenses:
|
127
|
+
- MIT
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
require_paths:
|
131
|
+
- lib
|
132
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
134
|
+
requirements:
|
135
|
+
- - ! '>='
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
requirements: []
|
145
|
+
rubyforge_project:
|
146
|
+
rubygems_version: 1.8.23
|
147
|
+
signing_key:
|
148
|
+
specification_version: 3
|
149
|
+
summary: My variation on game pacman.
|
150
|
+
test_files: []
|