cyberarm_engine 0.13.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -8
  3. data/.travis.yml +5 -5
  4. data/Gemfile +6 -6
  5. data/LICENSE.txt +21 -21
  6. data/README.md +73 -43
  7. data/Rakefile +10 -10
  8. data/bin/console +14 -14
  9. data/bin/setup +8 -8
  10. data/cyberarm_engine.gemspec +36 -36
  11. data/lib/cyberarm_engine.rb +49 -47
  12. data/lib/cyberarm_engine/animator.rb +53 -53
  13. data/lib/cyberarm_engine/background.rb +175 -175
  14. data/lib/cyberarm_engine/bounding_box.rb +149 -149
  15. data/lib/cyberarm_engine/common.rb +96 -96
  16. data/lib/cyberarm_engine/config_file.rb +46 -0
  17. data/lib/cyberarm_engine/engine.rb +101 -101
  18. data/lib/cyberarm_engine/game_object.rb +256 -256
  19. data/lib/cyberarm_engine/game_state.rb +88 -88
  20. data/lib/cyberarm_engine/gosu_ext/circle.rb +8 -8
  21. data/lib/cyberarm_engine/ray.rb +55 -55
  22. data/lib/cyberarm_engine/shader.rb +398 -262
  23. data/lib/cyberarm_engine/text.rb +146 -146
  24. data/lib/cyberarm_engine/timer.rb +22 -22
  25. data/lib/cyberarm_engine/transform.rb +272 -272
  26. data/lib/cyberarm_engine/ui/border_canvas.rb +100 -100
  27. data/lib/cyberarm_engine/ui/dsl.rb +98 -98
  28. data/lib/cyberarm_engine/ui/element.rb +275 -275
  29. data/lib/cyberarm_engine/ui/elements/button.rb +66 -66
  30. data/lib/cyberarm_engine/ui/elements/check_box.rb +58 -58
  31. data/lib/cyberarm_engine/ui/elements/container.rb +176 -176
  32. data/lib/cyberarm_engine/ui/elements/edit_line.rb +171 -171
  33. data/lib/cyberarm_engine/ui/elements/flow.rb +16 -16
  34. data/lib/cyberarm_engine/ui/elements/image.rb +51 -51
  35. data/lib/cyberarm_engine/ui/elements/label.rb +49 -49
  36. data/lib/cyberarm_engine/ui/elements/progress.rb +49 -49
  37. data/lib/cyberarm_engine/ui/elements/stack.rb +12 -12
  38. data/lib/cyberarm_engine/ui/elements/toggle_button.rb +55 -55
  39. data/lib/cyberarm_engine/ui/event.rb +46 -46
  40. data/lib/cyberarm_engine/ui/gui_state.rb +134 -134
  41. data/lib/cyberarm_engine/ui/style.rb +36 -36
  42. data/lib/cyberarm_engine/ui/theme.rb +120 -120
  43. data/lib/cyberarm_engine/vector.rb +289 -202
  44. data/lib/cyberarm_engine/version.rb +4 -4
  45. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9d7812c7b4efbe28fcb5068f0e2ce49df7f811888daa7aa275d21a80303265a
4
- data.tar.gz: 6a741be2083f6ca940e091cad73cb30ca9a31cfceed3344843e2aa6ecb412619
3
+ metadata.gz: df44f5d01eb555b4e210141def7448388e67a27059cb57c28d475a059af4013c
4
+ data.tar.gz: 072bc76caf9f09e33bb0272f30dd7c30877ddda2c2f820b3784208c5c189f7b2
5
5
  SHA512:
6
- metadata.gz: aee890370bf81d88face8ad113e59596d91cddc2b7f4de8fc2d34796f9b5bd705355ca2c0c9452d373ee24894b672418026f25479768dbe8ba60f116443e708f
7
- data.tar.gz: adc440c796d2180be124795c9ae608d958b1bb81a7129376de1473f0df83ba519d72cfe262939f3afba861be2cb078fab13cafae8276c7db3bff6f22eb0c5f42
6
+ metadata.gz: b2a039f52667d0a0360c13028f5c85346bb34c4b04759cec2fa77d14f51832477dca033ca213264ef83e41776f5e94715b4cc488e2deede70f3dbc2f6c05f830
7
+ data.tar.gz: d4fc61ff5cbb1815cc3c359e7c1ca5e7611382826e2c1fc2a705be0d33102aa3974ee437b7cba83271a07dd730157317102f75a0c3026908e904c370889514a8
data/.gitignore CHANGED
@@ -1,8 +1,8 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -1,5 +1,5 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.0
5
- before_install: gem install bundler -v 1.16.1
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.5.0
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in cyberarm_engine.gemspec
6
- gemspec
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in cyberarm_engine.gemspec
6
+ gemspec
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2018 Cyberarm
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Cyberarm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,43 +1,73 @@
1
- # CyberarmEngine
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cyberarm_engine`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
- ## Installation
8
-
9
- Add this line to your application's Gemfile:
10
-
11
- ```ruby
12
- gem 'cyberarm_engine'
13
- ```
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install cyberarm_engine
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/cyberarm/cyberarm_engine.
36
-
37
- ## License
38
-
39
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
-
41
- ## Code of Conduct
42
-
43
- Everyone interacting in the CyberarmEngine project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the ruby moto of "Matz is nice so we are nice."
1
+ # CyberarmEngine
2
+
3
+ Yet Another Game Engine On Top Of Gosu
4
+
5
+ ## Features
6
+ * [Shoes-like](http://shoesrb.com) GUI support
7
+ * OpenGL Shader support (requires [opengl-bindings](https://github.com/vaiorabbit/ruby-opengl) gem)
8
+ * Includes classes for handling Vectors, Rays, Bounding Boxes, and Transforms
9
+ * GameState system
10
+ * Monolithic GameObjects
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'cyberarm_engine'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install cyberarm_engine
27
+
28
+ ## Usage
29
+
30
+ ```ruby
31
+ require "cyberarm_engine"
32
+
33
+ class Hello < CyberarmEngine::GuiState
34
+ def setup
35
+ stack do
36
+ label "Hello World!"
37
+
38
+ button "close" do
39
+ window.close
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ class Window < CyberarmEngine::Engine
46
+ def initialize
47
+ super
48
+ self.show_cursor = true
49
+
50
+ push_state(Hello)
51
+ end
52
+ end
53
+
54
+ Window.new.show
55
+ ```
56
+
57
+ ## Development
58
+
59
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
60
+
61
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
62
+
63
+ ## Contributing
64
+
65
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cyberarm/cyberarm_engine.
66
+
67
+ ## License
68
+
69
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
70
+
71
+ ## Code of Conduct
72
+
73
+ Everyone interacting in the CyberarmEngine project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the ruby moto of "Matz is nice so we are nice."
data/Rakefile CHANGED
@@ -1,10 +1,10 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
3
-
4
- Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
8
- end
9
-
10
- task :default => :test
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -1,14 +1,14 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "cyberarm_engine"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "cyberarm_engine"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -1,36 +1,36 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "cyberarm_engine/version"
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "cyberarm_engine"
8
- spec.version = CyberarmEngine::VERSION
9
- spec.authors = ["Cyberarm"]
10
- spec.email = ["matthewlikesrobots@gmail.com"]
11
-
12
- spec.summary = %q{Make games quickly and easily with gosu}
13
- spec.description = %q{Yet another game making framework around gosu}
14
- spec.homepage = "https://github.com/cyberarm/cyberarm_engine"
15
- spec.license = "MIT"
16
-
17
- if spec.respond_to?(:metadata)
18
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
19
- else
20
- raise "RubyGems 2.0 or newer is required to protect against " \
21
- "public gem pushes."
22
- end
23
-
24
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
- f.match(%r{^(test|spec|features)/})
26
- end
27
- spec.bindir = "exe"
28
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
- spec.require_paths = ["lib"]
30
-
31
- spec.add_dependency "gosu", "~> 0.15.0"
32
-
33
- spec.add_development_dependency "bundler", "~> 1.16"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "minitest", "~> 5.0"
36
- end
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "cyberarm_engine/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cyberarm_engine"
8
+ spec.version = CyberarmEngine::VERSION
9
+ spec.authors = ["Cyberarm"]
10
+ spec.email = ["matthewlikesrobots@gmail.com"]
11
+
12
+ spec.summary = %q{Make games quickly and easily with gosu}
13
+ spec.description = %q{Yet another game making framework around gosu}
14
+ spec.homepage = "https://github.com/cyberarm/cyberarm_engine"
15
+ spec.license = "MIT"
16
+
17
+ if spec.respond_to?(:metadata)
18
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
19
+ else
20
+ raise "RubyGems 2.0 or newer is required to protect against " \
21
+ "public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
+ f.match(%r{^(test|spec|features)/})
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_dependency "gosu", "~> 0.15.0"
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.16"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "minitest", "~> 5.0"
36
+ end
@@ -1,47 +1,49 @@
1
- begin
2
- require File.expand_path("../../ffi-gosu/lib/gosu", File.dirname(__FILE__))
3
- rescue LoadError => e
4
- pp e
5
- require "gosu"
6
- end
7
-
8
- require_relative "cyberarm_engine/version"
9
-
10
- require_relative "cyberarm_engine/common"
11
-
12
- require_relative "cyberarm_engine/gosu_ext/circle"
13
-
14
- require_relative "cyberarm_engine/game_object"
15
- require_relative "cyberarm_engine/engine"
16
-
17
- require_relative "cyberarm_engine/bounding_box"
18
- require_relative "cyberarm_engine/vector"
19
- require_relative "cyberarm_engine/transform"
20
- require_relative "cyberarm_engine/ray"
21
- require_relative "cyberarm_engine/shader" if defined?(OpenGL)
22
- require_relative "cyberarm_engine/background"
23
- require_relative "cyberarm_engine/animator"
24
-
25
- require_relative "cyberarm_engine/text"
26
- require_relative "cyberarm_engine/timer"
27
-
28
- require_relative "cyberarm_engine/ui/dsl"
29
-
30
- require_relative "cyberarm_engine/ui/theme"
31
- require_relative "cyberarm_engine/ui/event"
32
- require_relative "cyberarm_engine/ui/style"
33
- require_relative "cyberarm_engine/ui/border_canvas"
34
- require_relative "cyberarm_engine/ui/element"
35
- require_relative "cyberarm_engine/ui/elements/label"
36
- require_relative "cyberarm_engine/ui/elements/button"
37
- require_relative "cyberarm_engine/ui/elements/toggle_button"
38
- require_relative "cyberarm_engine/ui/elements/edit_line"
39
- require_relative "cyberarm_engine/ui/elements/image"
40
- require_relative "cyberarm_engine/ui/elements/container"
41
- require_relative "cyberarm_engine/ui/elements/flow"
42
- require_relative "cyberarm_engine/ui/elements/stack"
43
- require_relative "cyberarm_engine/ui/elements/check_box"
44
- require_relative "cyberarm_engine/ui/elements/progress"
45
-
46
- require_relative "cyberarm_engine/game_state"
47
- require_relative "cyberarm_engine/ui/gui_state"
1
+ begin
2
+ require File.expand_path("../../ffi-gosu/lib/gosu", File.dirname(__FILE__))
3
+ rescue LoadError => e
4
+ pp e
5
+ require "gosu"
6
+ end
7
+ require "json"
8
+
9
+ require_relative "cyberarm_engine/version"
10
+
11
+ require_relative "cyberarm_engine/common"
12
+
13
+ require_relative "cyberarm_engine/gosu_ext/circle"
14
+
15
+ require_relative "cyberarm_engine/game_object"
16
+ require_relative "cyberarm_engine/engine"
17
+
18
+ require_relative "cyberarm_engine/bounding_box"
19
+ require_relative "cyberarm_engine/vector"
20
+ require_relative "cyberarm_engine/transform"
21
+ require_relative "cyberarm_engine/ray"
22
+ require_relative "cyberarm_engine/shader" if defined?(OpenGL)
23
+ require_relative "cyberarm_engine/background"
24
+ require_relative "cyberarm_engine/animator"
25
+
26
+ require_relative "cyberarm_engine/text"
27
+ require_relative "cyberarm_engine/timer"
28
+ require_relative "cyberarm_engine/config_file"
29
+
30
+ require_relative "cyberarm_engine/ui/dsl"
31
+
32
+ require_relative "cyberarm_engine/ui/theme"
33
+ require_relative "cyberarm_engine/ui/event"
34
+ require_relative "cyberarm_engine/ui/style"
35
+ require_relative "cyberarm_engine/ui/border_canvas"
36
+ require_relative "cyberarm_engine/ui/element"
37
+ require_relative "cyberarm_engine/ui/elements/label"
38
+ require_relative "cyberarm_engine/ui/elements/button"
39
+ require_relative "cyberarm_engine/ui/elements/toggle_button"
40
+ require_relative "cyberarm_engine/ui/elements/edit_line"
41
+ require_relative "cyberarm_engine/ui/elements/image"
42
+ require_relative "cyberarm_engine/ui/elements/container"
43
+ require_relative "cyberarm_engine/ui/elements/flow"
44
+ require_relative "cyberarm_engine/ui/elements/stack"
45
+ require_relative "cyberarm_engine/ui/elements/check_box"
46
+ require_relative "cyberarm_engine/ui/elements/progress"
47
+
48
+ require_relative "cyberarm_engine/game_state"
49
+ require_relative "cyberarm_engine/ui/gui_state"