gubby-gosu 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/examples/bloons/asset/balloon.svg +79 -0
- data/examples/bloons/asset/bloon.png +0 -0
- data/examples/bloons/asset/p1.wav +0 -0
- data/examples/bloons/asset/p2.wav +0 -0
- data/examples/bloons/asset/p3.wav +0 -0
- data/examples/bloons/asset/p4.wav +0 -0
- data/examples/bloons/asset/p5.wav +0 -0
- data/examples/bloons/asset/popped.png +0 -0
- data/examples/bloons/bloons.rb +180 -0
- data/examples/bloons/profile.txt +90 -0
- data/gubby-gosu.gemspec +27 -0
- data/lib/gubby/gosu.rb +10 -0
- data/lib/gubby/gosu/components/color.rb +9 -0
- data/lib/gubby/gosu/components/sprite_2d.rb +15 -0
- data/lib/gubby/gosu/systems/gosu_render_system.rb +17 -0
- data/lib/gubby/gosu/version.rb +2 -0
- metadata +122 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2013 Justin Basinger
|
|
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,29 @@
|
|
|
1
|
+
# Gubby::Gosu
|
|
2
|
+
|
|
3
|
+
TODO: Write a gem description
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
gem 'gubby-gosu'
|
|
10
|
+
|
|
11
|
+
And then execute:
|
|
12
|
+
|
|
13
|
+
$ bundle
|
|
14
|
+
|
|
15
|
+
Or install it yourself as:
|
|
16
|
+
|
|
17
|
+
$ gem install gubby-gosu
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
TODO: Write usage instructions here
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
1. Fork it
|
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "bundler/gem_tasks"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
6
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
7
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
width="744.09448819"
|
|
13
|
+
height="1052.3622047"
|
|
14
|
+
id="svg2"
|
|
15
|
+
version="1.1"
|
|
16
|
+
inkscape:version="0.47 r22583"
|
|
17
|
+
sodipodi:docname="balloon.svg">
|
|
18
|
+
<defs
|
|
19
|
+
id="defs4">
|
|
20
|
+
<inkscape:perspective
|
|
21
|
+
sodipodi:type="inkscape:persp3d"
|
|
22
|
+
inkscape:vp_x="0 : 526.18109 : 1"
|
|
23
|
+
inkscape:vp_y="0 : 1000 : 0"
|
|
24
|
+
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
|
25
|
+
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
|
26
|
+
id="perspective10" />
|
|
27
|
+
</defs>
|
|
28
|
+
<sodipodi:namedview
|
|
29
|
+
id="base"
|
|
30
|
+
pagecolor="#ffffff"
|
|
31
|
+
bordercolor="#666666"
|
|
32
|
+
borderopacity="1.0"
|
|
33
|
+
inkscape:pageopacity="0.0"
|
|
34
|
+
inkscape:pageshadow="2"
|
|
35
|
+
inkscape:zoom="5.6"
|
|
36
|
+
inkscape:cx="276.23274"
|
|
37
|
+
inkscape:cy="728.48284"
|
|
38
|
+
inkscape:document-units="px"
|
|
39
|
+
inkscape:current-layer="layer1"
|
|
40
|
+
showgrid="false"
|
|
41
|
+
inkscape:window-width="1600"
|
|
42
|
+
inkscape:window-height="848"
|
|
43
|
+
inkscape:window-x="-8"
|
|
44
|
+
inkscape:window-y="-8"
|
|
45
|
+
inkscape:window-maximized="1" />
|
|
46
|
+
<metadata
|
|
47
|
+
id="metadata7">
|
|
48
|
+
<rdf:RDF>
|
|
49
|
+
<cc:Work
|
|
50
|
+
rdf:about="">
|
|
51
|
+
<dc:format>image/svg+xml</dc:format>
|
|
52
|
+
<dc:type
|
|
53
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
54
|
+
<dc:title></dc:title>
|
|
55
|
+
</cc:Work>
|
|
56
|
+
</rdf:RDF>
|
|
57
|
+
</metadata>
|
|
58
|
+
<g
|
|
59
|
+
inkscape:label="Layer 1"
|
|
60
|
+
inkscape:groupmode="layer"
|
|
61
|
+
id="layer1">
|
|
62
|
+
<path
|
|
63
|
+
inkscape:export-ydpi="90"
|
|
64
|
+
inkscape:export-xdpi="90"
|
|
65
|
+
inkscape:export-filename="D:\Repos\ruby\gubby\gubby_gosu\test\asset\bloon.png"
|
|
66
|
+
sodipodi:nodetypes="csscccccccssc"
|
|
67
|
+
id="path3596"
|
|
68
|
+
d="m 203.94643,265.89286 c -17.51845,0 -31.71875,14.80439 -31.71875,33.0625 0,15.41414 11.5467,26.40657 23.8125,32.03125 1.47217,0.67509 4.3529,1.42286 6.03125,1.50446 l -3.40179,4.55358 2.39969,-1.69253 1.68249,1.50552 1.69908,-1.29067 2.80803,1.86607 -3.54911,-4.91072 c 1.52426,-0.0658 6.40917,-0.8103 7.73661,-1.44196 9.25605,-4.40439 24.21875,-16.5596 24.21875,-32.125 0,-18.25811 -14.20031,-33.0625 -31.71875,-33.0625 z"
|
|
69
|
+
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.56008482;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0" />
|
|
70
|
+
<path
|
|
71
|
+
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.56008482;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0"
|
|
72
|
+
d="m 285.73215,315.53572 c -16.80417,-7.14286 -30.11161,-8.94561 -30.11161,9.3125 0,15.41414 11.5467,-4.30772 23.8125,1.31696 1.47217,0.67509 4.3529,1.42286 6.03125,1.50446 l -3.40179,4.55358 2.39969,-1.69253 1.68249,1.50552 1.69908,-1.29067 2.80803,1.86607 -3.54911,-4.91072 c 1.52426,-0.0658 6.40917,-0.8103 7.73661,-1.44196 9.25605,-4.40439 25.46875,8.97611 25.46875,-6.58929 0,-18.25811 -17.05745,-4.13392 -34.57589,-4.13392 z"
|
|
73
|
+
id="path2816"
|
|
74
|
+
sodipodi:nodetypes="csscccccccssc"
|
|
75
|
+
inkscape:export-filename="D:\Repos\ruby\gubby\gubby_gosu\test\asset\popped.png"
|
|
76
|
+
inkscape:export-xdpi="90"
|
|
77
|
+
inkscape:export-ydpi="90" />
|
|
78
|
+
</g>
|
|
79
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
require 'gosu'
|
|
2
|
+
require 'gubby'
|
|
3
|
+
require 'gubby/gosu'
|
|
4
|
+
require 'ruby-prof'
|
|
5
|
+
|
|
6
|
+
include Gubby
|
|
7
|
+
include Gubby::Systems
|
|
8
|
+
include Gubby::Components
|
|
9
|
+
|
|
10
|
+
#include Gubby::Systems::Gosu
|
|
11
|
+
#include Gubby::Components::Gosu
|
|
12
|
+
|
|
13
|
+
#Cheap out for moving and stuff.
|
|
14
|
+
#Probably not the best example. Should be a move system or something.
|
|
15
|
+
class UpdateSystem < GameSystem
|
|
16
|
+
|
|
17
|
+
def initialize()
|
|
18
|
+
super(Update)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def update()
|
|
22
|
+
@entities.each do |e|
|
|
23
|
+
if e.update.is_a?(Symbol) then
|
|
24
|
+
e.send(e.update)
|
|
25
|
+
end
|
|
26
|
+
if e.update.is_a?(Proc) then
|
|
27
|
+
e.update.call
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
class PopSystem < GameSystem
|
|
35
|
+
|
|
36
|
+
def initialize(window)
|
|
37
|
+
super(Poppable, Sprite2D, Position2D)
|
|
38
|
+
@window = window
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def button_down()
|
|
42
|
+
|
|
43
|
+
bloon = @entities.reject{|e|
|
|
44
|
+
e.popped == true || ((e.y + e.image.height/2) < 0 || (e.y + e.image.height/2) > @window.height)
|
|
45
|
+
}.sample
|
|
46
|
+
bloon.popped = true unless bloon.nil?
|
|
47
|
+
|
|
48
|
+
@entities.each do |e|
|
|
49
|
+
|
|
50
|
+
if e.popped && e.poppable then
|
|
51
|
+
e.poppable = false
|
|
52
|
+
e.load(@window,"asset/popped.png",false)
|
|
53
|
+
e.speed = 5 + rand(1..e.speed*2)
|
|
54
|
+
e.sounds.sample.play
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
module Update
|
|
64
|
+
|
|
65
|
+
attr_accessor :update
|
|
66
|
+
|
|
67
|
+
def Update.extend_object(e)
|
|
68
|
+
super(e)
|
|
69
|
+
e.update = Proc.new(){}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
module Poppable
|
|
75
|
+
attr_accessor :popped, :poppable
|
|
76
|
+
|
|
77
|
+
def Poppable.extend_object(e)
|
|
78
|
+
super(e)
|
|
79
|
+
e.popped = false
|
|
80
|
+
e.poppable = true
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
module Speed
|
|
86
|
+
attr_accessor :speed
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class Bloon < GameEntity
|
|
90
|
+
|
|
91
|
+
attr_reader :sounds
|
|
92
|
+
|
|
93
|
+
def initialize(window)
|
|
94
|
+
super("bloon", Sprite2D, Position2D, Color, Update, Poppable, Speed)
|
|
95
|
+
|
|
96
|
+
@window = window
|
|
97
|
+
self.speed = rand(1..5)
|
|
98
|
+
|
|
99
|
+
load(window,"asset/bloon.png", false)
|
|
100
|
+
|
|
101
|
+
self.x = rand(0+self.image.width/2..window.width-self.image.width/2)
|
|
102
|
+
self.y = 0 - rand(self.image.height/2..self.image.height*3)
|
|
103
|
+
|
|
104
|
+
self.color = Gosu::Color.new(0xff000000)
|
|
105
|
+
self.color.red = rand(40..255)
|
|
106
|
+
self.color.green = rand(40..255)
|
|
107
|
+
self.color.blue = rand(40..255)
|
|
108
|
+
|
|
109
|
+
self.update = :move
|
|
110
|
+
|
|
111
|
+
@sounds = []
|
|
112
|
+
(1..5).each do |i|
|
|
113
|
+
@sounds << Gosu::Sample.new(window, "asset/p#{i.to_s}.wav")
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def move()
|
|
119
|
+
|
|
120
|
+
self.y += self.speed
|
|
121
|
+
|
|
122
|
+
if self.popped then
|
|
123
|
+
self.angle += self.speed/2
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if (self.y + self.image.width/2) > @window.height then
|
|
127
|
+
self.destroy()
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
class MyWindow < Gosu::Window
|
|
135
|
+
|
|
136
|
+
def initialize
|
|
137
|
+
#super 640, 480, false
|
|
138
|
+
super 1024, 768, true
|
|
139
|
+
self.caption = 'Pop the bloons!'
|
|
140
|
+
|
|
141
|
+
@engine = GameEngine.new(GosuRenderSystem.new(), UpdateSystem.new(), PopSystem.new(self))
|
|
142
|
+
@max_bloons = 40
|
|
143
|
+
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def draw
|
|
147
|
+
@engine.run(:draw)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
def update
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
@engine.run(:update)
|
|
155
|
+
|
|
156
|
+
if @engine.entities.count < @max_bloons then
|
|
157
|
+
@engine.add_entity(Bloon.new(self))
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if button_down? Gosu::KbEscape then
|
|
161
|
+
close
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def button_down(id)
|
|
169
|
+
@engine.run(:button_down)
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
RubyProf.start
|
|
175
|
+
|
|
176
|
+
window = MyWindow.new
|
|
177
|
+
window.show
|
|
178
|
+
|
|
179
|
+
profile = RubyProf.stop
|
|
180
|
+
RubyProf::FlatPrinter.new(profile).print(File.open("profile.txt","w+"))
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Thread ID: 2317728
|
|
2
|
+
Fiber ID: 23047572
|
|
3
|
+
Total: 6.083000
|
|
4
|
+
Sort by: self_time
|
|
5
|
+
|
|
6
|
+
%self total self wait child calls name
|
|
7
|
+
61.07 5.834 3.715 0.000 2.119 1 Gosu::Window#show_internal
|
|
8
|
+
13.37 0.813 0.813 0.000 0.000 1 Gosu::Window#close
|
|
9
|
+
12.07 0.734 0.734 0.000 0.000 115 Gosu::Image#initialize
|
|
10
|
+
7.07 0.430 0.430 0.000 0.000 350 Gosu::Sample#initialize_
|
|
11
|
+
4.09 0.249 0.249 0.000 0.000 1 Gosu::Window#initialize
|
|
12
|
+
0.39 0.024 0.024 0.000 0.000 7689 Gosu::Image#draw_rot
|
|
13
|
+
0.35 0.030 0.021 0.000 0.009 7659 Bloon#move
|
|
14
|
+
0.08 0.005 0.005 0.000 0.000 350 <Class::Gosu::Sample>#allocate
|
|
15
|
+
0.08 0.452 0.005 0.000 0.447 70 Range#each
|
|
16
|
+
0.07 0.004 0.004 0.000 0.000 19124 BasicObject#==
|
|
17
|
+
0.07 0.435 0.004 0.000 0.431 350 Gosu::Sample#initialize
|
|
18
|
+
0.07 0.004 0.004 0.000 0.000 7799 Gosu::Image#width
|
|
19
|
+
0.07 0.004 0.004 0.000 0.000 51 Array#reject
|
|
20
|
+
0.05 0.003 0.003 0.000 0.000 350 Fixnum#to_s
|
|
21
|
+
0.05 0.003 0.003 0.000 0.000 8361 Gosu::Window#height
|
|
22
|
+
0.05 0.003 0.003 0.000 0.000 1431 Kernel#respond_to?
|
|
23
|
+
0.03 0.003 0.002 0.000 0.001 70 <Module::Position2D>#extend_object
|
|
24
|
+
0.03 0.002 0.002 0.000 0.000 16158 Kernel#is_a?
|
|
25
|
+
0.03 0.125 0.002 0.000 0.123 477 GameEngine#run
|
|
26
|
+
0.03 0.043 0.002 0.000 0.041 426 *Gosu::Window#protected_draw_2
|
|
27
|
+
0.03 1.165 0.002 0.000 1.163 70 Bloon#initialize
|
|
28
|
+
0.03 0.006 0.002 0.000 0.004 580 Array#include?
|
|
29
|
+
0.02 0.001 0.001 0.000 0.000 420 Module#extend_object
|
|
30
|
+
0.02 0.001 0.001 0.000 0.000 120 Array#delete
|
|
31
|
+
0.02 2.033 0.001 0.000 2.032 213 MyWindow#update
|
|
32
|
+
0.02 0.001 0.001 0.000 0.000 76 NilClass#nil?
|
|
33
|
+
0.02 0.004 0.001 0.000 0.003 420 Kernel#extend
|
|
34
|
+
0.02 0.037 0.001 0.000 0.036 51 PopSystem#button_down
|
|
35
|
+
0.02 0.001 0.001 0.000 0.000 477 Symbol#to_s
|
|
36
|
+
0.02 0.001 0.001 0.000 0.000 213 Gosu::Window#needs_redraw?
|
|
37
|
+
0.02 0.001 0.001 0.000 0.000 70 Gosu::Color#initialize
|
|
38
|
+
0.02 1.446 0.001 0.000 1.445 610 *Class#new
|
|
39
|
+
0.02 0.001 0.001 0.000 0.000 70 <Class::Gosu::Color>#allocate
|
|
40
|
+
0.02 0.001 0.001 0.000 0.000 350 Array#first
|
|
41
|
+
0.02 0.001 0.001 0.000 0.000 465 Kernel#rand
|
|
42
|
+
0.00 5.834 0.000 0.000 5.834 744 *Gosu::Window#show
|
|
43
|
+
0.00 0.005 0.000 0.000 0.005 70 GameEngine#add_entity
|
|
44
|
+
0.00 0.000 0.000 0.000 0.000 45 Gosu::Sample#play
|
|
45
|
+
0.00 0.000 0.000 0.000 0.000 115 <Class::Gosu::Image>#allocate
|
|
46
|
+
0.00 0.734 0.000 0.000 0.734 115 Sprite2D#load
|
|
47
|
+
0.00 0.000 0.000 0.000 0.000 465 Fixnum#-
|
|
48
|
+
0.00 0.000 0.000 0.000 0.000 96 Array#sample
|
|
49
|
+
0.00 0.000 0.000 0.000 0.000 70 Gosu::Window#width
|
|
50
|
+
0.00 0.000 0.000 0.000 0.000 70 <Module::Poppable>#extend_object
|
|
51
|
+
0.00 0.000 0.000 0.000 0.000 70 BasicObject#initialize
|
|
52
|
+
0.00 0.000 0.000 0.000 0.000 70 <Class::Proc>#new
|
|
53
|
+
0.00 0.000 0.000 0.000 0.000 70 <Module::Update>#extend_object
|
|
54
|
+
0.00 0.000 0.000 0.000 0.000 50 Gosu::Window#button_up
|
|
55
|
+
0.00 0.000 0.000 0.000 0.000 420 Module#extended
|
|
56
|
+
0.00 0.000 0.000 0.000 0.000 185 <Class::Range>#allocate
|
|
57
|
+
0.00 0.000 0.000 0.000 0.000 115 String#to_str
|
|
58
|
+
0.00 0.005 0.000 0.000 0.005 70 GameEntity#add_component
|
|
59
|
+
0.00 0.000 0.000 0.000 0.000 115 Kernel#nil?
|
|
60
|
+
0.00 0.005 0.000 0.000 0.005 70 GameEntity#initialize
|
|
61
|
+
0.00 0.000 0.000 0.000 0.000 1996 Gosu::Image#height
|
|
62
|
+
0.00 0.000 0.000 0.000 0.000 213 Array#count
|
|
63
|
+
0.00 0.046 0.000 0.000 0.046 213 UpdateSystem#update
|
|
64
|
+
0.00 0.000 0.000 0.000 0.000 70 Gosu::Color#red=
|
|
65
|
+
0.00 0.000 0.000 0.000 0.000 216 Gosu::Window#needs_cursor?
|
|
66
|
+
0.00 0.036 0.000 0.000 0.036 213 GosuRenderSystem#draw
|
|
67
|
+
0.00 0.000 0.000 0.000 0.000 70 Gosu::Color#green=
|
|
68
|
+
0.00 0.000 0.000 0.000 0.000 954 Kernel#respond_to_missing?
|
|
69
|
+
0.00 0.002 0.000 0.000 0.002 30 GameEntity#destroy
|
|
70
|
+
0.00 0.003 0.000 0.000 0.003 477 Array#select
|
|
71
|
+
0.00 0.000 0.000 0.000 0.000 70 Gosu::Color#blue=
|
|
72
|
+
0.00 0.039 0.000 0.000 0.039 213 MyWindow#draw
|
|
73
|
+
0.00 0.038 0.000 0.000 0.038 51 MyWindow#button_down
|
|
74
|
+
0.00 0.002 0.000 0.000 0.002 30 GameEngine#remove_entity
|
|
75
|
+
0.00 0.000 0.000 0.000 0.000 213 Gosu::Window#button_down?
|
|
76
|
+
0.00 0.000 0.000 0.000 0.000 703 Array#push
|
|
77
|
+
0.00 0.127 0.000 0.000 0.127 1335 *Array#each
|
|
78
|
+
0.00 0.000 0.000 0.000 0.000 1 GameEngine#initialize
|
|
79
|
+
0.00 0.000 0.000 0.000 0.000 1 PopSystem#initialize
|
|
80
|
+
0.00 0.000 0.000 0.000 0.000 1 UpdateSystem#initialize
|
|
81
|
+
0.00 0.000 0.000 0.000 0.000 3 GameSystem#initialize
|
|
82
|
+
0.00 0.000 0.000 0.000 0.000 1 GosuRenderSystem#initialize
|
|
83
|
+
0.00 0.000 0.000 0.000 0.000 74 <Class::BasicObject>#allocate
|
|
84
|
+
0.00 0.000 0.000 0.000 0.000 1 Gosu::Window#caption=
|
|
85
|
+
0.00 0.000 0.000 0.000 0.000 350 Array#shift
|
|
86
|
+
0.00 0.249 0.000 0.000 0.249 1 MyWindow#initialize
|
|
87
|
+
0.00 0.000 0.000 0.000 0.000 1 <Class::Gosu::Window>#allocate
|
|
88
|
+
0.00 0.003 0.000 0.000 0.003 210 GameSystem#refresh_entity
|
|
89
|
+
|
|
90
|
+
* indicates recursively called methods
|
data/gubby-gosu.gemspec
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'gubby/gosu/version'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "gubby-gosu"
|
|
8
|
+
spec.version = "0.0.1"
|
|
9
|
+
spec.authors = ["Justin Basinger"]
|
|
10
|
+
spec.email = ["justin.m.basinger@gmail.com"]
|
|
11
|
+
spec.description = "Gosu specific additions to Gubby. For games!"
|
|
12
|
+
spec.summary = "Gosu specific additions to Gubby."
|
|
13
|
+
spec.homepage = ""
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files`.split($/)
|
|
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_development_dependency "bundler", "~> 1.3"
|
|
22
|
+
spec.add_development_dependency "rake"
|
|
23
|
+
spec.add_development_dependency "gosu"
|
|
24
|
+
spec.add_development_dependency "gubby"
|
|
25
|
+
spec.add_development_dependency "ruby-prof"
|
|
26
|
+
|
|
27
|
+
end
|
data/lib/gubby/gosu.rb
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Gubby
|
|
2
|
+
module Systems
|
|
3
|
+
class GosuRenderSystem < GameSystem
|
|
4
|
+
|
|
5
|
+
def initialize()
|
|
6
|
+
super(Position2D, Sprite2D, Color)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def draw()
|
|
10
|
+
@entities.each do |e|
|
|
11
|
+
e.image.draw_rot(e.x, e.y, e.z, e.angle, e.center_x, e.center_y, e.factor_x, e.factor_y, e.color)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gubby-gosu
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Justin Basinger
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2013-04-19 00:00:00.000000000 Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: bundler
|
|
16
|
+
requirement: &22918920 !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ~>
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '1.3'
|
|
22
|
+
type: :development
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: *22918920
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: rake
|
|
27
|
+
requirement: &22935060 !ruby/object:Gem::Requirement
|
|
28
|
+
none: false
|
|
29
|
+
requirements:
|
|
30
|
+
- - ! '>='
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: *22935060
|
|
36
|
+
- !ruby/object:Gem::Dependency
|
|
37
|
+
name: gosu
|
|
38
|
+
requirement: &22934784 !ruby/object:Gem::Requirement
|
|
39
|
+
none: false
|
|
40
|
+
requirements:
|
|
41
|
+
- - ! '>='
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '0'
|
|
44
|
+
type: :development
|
|
45
|
+
prerelease: false
|
|
46
|
+
version_requirements: *22934784
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: gubby
|
|
49
|
+
requirement: &22934532 !ruby/object:Gem::Requirement
|
|
50
|
+
none: false
|
|
51
|
+
requirements:
|
|
52
|
+
- - ! '>='
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '0'
|
|
55
|
+
type: :development
|
|
56
|
+
prerelease: false
|
|
57
|
+
version_requirements: *22934532
|
|
58
|
+
- !ruby/object:Gem::Dependency
|
|
59
|
+
name: ruby-prof
|
|
60
|
+
requirement: &22934280 !ruby/object:Gem::Requirement
|
|
61
|
+
none: false
|
|
62
|
+
requirements:
|
|
63
|
+
- - ! '>='
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '0'
|
|
66
|
+
type: :development
|
|
67
|
+
prerelease: false
|
|
68
|
+
version_requirements: *22934280
|
|
69
|
+
description: Gosu specific additions to Gubby. For games!
|
|
70
|
+
email:
|
|
71
|
+
- justin.m.basinger@gmail.com
|
|
72
|
+
executables: []
|
|
73
|
+
extensions: []
|
|
74
|
+
extra_rdoc_files: []
|
|
75
|
+
files:
|
|
76
|
+
- .gitignore
|
|
77
|
+
- Gemfile
|
|
78
|
+
- LICENSE.txt
|
|
79
|
+
- README.md
|
|
80
|
+
- Rakefile
|
|
81
|
+
- examples/bloons/asset/balloon.svg
|
|
82
|
+
- examples/bloons/asset/bloon.png
|
|
83
|
+
- examples/bloons/asset/p1.wav
|
|
84
|
+
- examples/bloons/asset/p2.wav
|
|
85
|
+
- examples/bloons/asset/p3.wav
|
|
86
|
+
- examples/bloons/asset/p4.wav
|
|
87
|
+
- examples/bloons/asset/p5.wav
|
|
88
|
+
- examples/bloons/asset/popped.png
|
|
89
|
+
- examples/bloons/bloons.rb
|
|
90
|
+
- examples/bloons/profile.txt
|
|
91
|
+
- gubby-gosu.gemspec
|
|
92
|
+
- lib/gubby/gosu.rb
|
|
93
|
+
- lib/gubby/gosu/components/color.rb
|
|
94
|
+
- lib/gubby/gosu/components/sprite_2d.rb
|
|
95
|
+
- lib/gubby/gosu/systems/gosu_render_system.rb
|
|
96
|
+
- lib/gubby/gosu/version.rb
|
|
97
|
+
homepage: ''
|
|
98
|
+
licenses:
|
|
99
|
+
- MIT
|
|
100
|
+
post_install_message:
|
|
101
|
+
rdoc_options: []
|
|
102
|
+
require_paths:
|
|
103
|
+
- lib
|
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
|
+
none: false
|
|
106
|
+
requirements:
|
|
107
|
+
- - ! '>='
|
|
108
|
+
- !ruby/object:Gem::Version
|
|
109
|
+
version: '0'
|
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
|
+
none: false
|
|
112
|
+
requirements:
|
|
113
|
+
- - ! '>='
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '0'
|
|
116
|
+
requirements: []
|
|
117
|
+
rubyforge_project:
|
|
118
|
+
rubygems_version: 1.8.11
|
|
119
|
+
signing_key:
|
|
120
|
+
specification_version: 3
|
|
121
|
+
summary: Gosu specific additions to Gubby.
|
|
122
|
+
test_files: []
|