ang 9.19.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: eada233637319b72f65b42bbfea9ec5a53858cfb
4
+ data.tar.gz: fe25e7877b1a758aa8b47666e293bc33be850ffd
5
+ SHA512:
6
+ metadata.gz: 482dd2ef54f98d5fb11af1e936f64f338fa53bace34e1778cc2eceab75e30a1de2ec714b03f88f944f560da202ce6faa4dfa8a950582248e5913e8cd527427c2
7
+ data.tar.gz: a8082b4a0e0ec8725639b82e5aef85eac04f939736862126920bf877c67ae9c121a57fd5e2019a8e1d2cb15aca47fae7d5811d35fcbf9d2c78fc2061cbdd5cc8
@@ -0,0 +1,88 @@
1
+ 9.19.0 : 2014-11-07 20:17:51 +0100
2
+ 9.18.0 : 2013-04-18 19:52:07 +0200
3
+ ang.gemspec : d
4
+ VERSION : q
5
+ 9.17.0 : 2013-04-18 19:50:58 +0200
6
+ ang.gemspec : comment
7
+ 9.16.0 : 2013-04-18 19:48:25 +0200
8
+ agent.rb : test not ruby 2
9
+ main.rb : test not ruby 2
10
+ VERSION : nothing
11
+ 9.15.0 : 2013-03-08 20:19:24 +0100
12
+ star.rb : v
13
+ VERSION : v
14
+ 9.14.0 : 2013-03-08 20:12:48 +0100
15
+ star.rb : star variable dimention
16
+ agent.rb : smoother
17
+ star.rb : hole star
18
+ agent.rb : a little more difficulty
19
+ player.rb : age
20
+ missile.rb : age
21
+ agent.rb : missile yellow
22
+ Starfighter.bmp : create yellow
23
+ 9.13.0 : 2013-01-22 18:05:42 +0100
24
+ player.rb : missile creation
25
+ missile.rb : age creation
26
+ agent.rb : creation missille from net
27
+ 9.12.0 : 2013-01-22 17:47:08 +0100
28
+ agent.rb : text align
29
+ net.rb : event queue by pooling and by wait
30
+ multicast_test.rb : comments
31
+ agent.rb : key nsert for rocket launch
32
+ README.md : test explanation
33
+ 9.11.0 : 2013-01-17 18:52:18 +0100
34
+ agent.rb : recho empty
35
+ net.rb : echo traces
36
+ VERSION : q
37
+ README.md : explanation for muticast test tool
38
+ 9.10.0 : 2013-01-17 18:25:27 +0100
39
+ player.rb : missile lancher
40
+ net.rb : echo, recho, missile
41
+ agent.rb : missile
42
+ Starfighter.bmp : missille
43
+ README.md : Update todo
44
+ VERSION : n
45
+ 9.9.0 : 2013-01-16 17:28:28 +0100
46
+ README.md : avancement multiplayer
47
+ 9.8.0 : 2013-01-16 13:00:55 +0100
48
+ agent.rb : corrections
49
+ 9.7.0 : 2013-01-16 12:54:52 +0100
50
+ tools.rb : newton more smooth
51
+ star.rb : initial position stronger
52
+ player.rb : gavity k/d**2, more smooth
53
+ agent.rb : reglages
54
+ 9.5.0 : 2013-01-16 12:19:43 +0100
55
+ agent.rb : game easyer
56
+ 9.4.0 : 2013-01-15 21:48:10 +0100
57
+ net.rb : multicasting for win 7 and winxp and multiplayer on same host
58
+ 9.3.0 : 2013-01-15 20:33:40 +0100
59
+ net.rb : check multicast
60
+ 9.2.0 : 2013-01-15 20:25:36 +0100
61
+ ang.gemspec : add angm to executables
62
+ VERSION : to 3 number
63
+ 9.0 : 2013-01-15 00:16:53 +0100
64
+ agent.rb : ending game
65
+ 8.0 : 2013-01-15 00:02:08 +0100
66
+ agent.rb : scare init
67
+ 7.0 : 2013-01-15 00:00:48 +0100
68
+ star.rb : send planetoid rayon
69
+ player.rb : plyer
70
+ net.rb : is_master reinitialisation
71
+ agent.rb : multiplayer start/end
72
+ README.md : multiplayer status
73
+ README.md : s
74
+ 6.0 : 2013-01-14 17:49:09 +0100
75
+ star.rb : index
76
+ player.rb : reglages
77
+ net.rb : comments send/received
78
+ agent.rb : comment distributed
79
+ README.md : update for multiplayer
80
+ star.rb : license
81
+ player.rb : license
82
+ net.rb : license
83
+ agent.rb : license
84
+ main_screencast.rb : license
85
+ main.rb : license
86
+ 5.0 : 2013-01-11 23:55:27 +0100
87
+ README.md : net
88
+ 4.0 : 2013-01-11 23:52:36 +0100
@@ -0,0 +1,86 @@
1
+ ANG : spacial navigation micro-game
2
+ ==================================
3
+
4
+ Navigate in space, pursuite some star and use planet gravity to
5
+ navigate.
6
+
7
+ In developpement,
8
+ Working, but missing menu, setup, level choice ....
9
+
10
+
11
+ Free to use, modify and distribute.
12
+
13
+
14
+ Multigamer
15
+ =========
16
+
17
+
18
+ In net directory, a ang game, version multi-player on local network,
19
+ use Multicast (so work only on LAN).
20
+
21
+ The game : same as ang, but all players must collaborate for destroy a
22
+ maximum of stars.
23
+
24
+ Usage:
25
+ > angm
26
+
27
+ For checking multicast working, and timings on your host/network :
28
+ > angm_net_test # can be run multiple in same host and/or on distinct host
29
+
30
+ On my host, I get
31
+ * 23 ms between application on same host
32
+ * 30 ms between application on distinct host, same LAN
33
+
34
+
35
+
36
+ Done:
37
+ * auto discovery of player, first player present is the 'master'
38
+ * Send master current planet/star configuration to new players
39
+ * Player position/speed/accelerations are replicates on each other players
40
+ * Star destructions are replicates
41
+ * Keyboard textual input are sending/display on all other player
42
+ * Multicast for winxp, win 7 ok, withe 1.3p362, (Linux to be checked)
43
+
44
+ TODO:
45
+ * start/end/restart game
46
+ * introduction, help
47
+ * transmition of game parameter to all (nb star, coefs...), current version need
48
+ to be exactly identique for each gamer
49
+ * display list of current players, with gamer name
50
+
51
+
52
+ Inspiration
53
+ ===========
54
+
55
+ Demo of gosu
56
+ Raster file came directly from these.
57
+ Code is remasterised a lot
58
+
59
+ http://regisaubarede.posterous.com/tag/game
60
+
61
+ Physics
62
+ =======
63
+ Newton law ( F=K.M.m/Dist**2 ) give a gameplay too reactive, so I use my own gravity version :)
64
+ Linear low attraction : ( F=K.M.m/Dist ) give a gameplay too smoth.
65
+
66
+ so i used : F=max( Newton law, Linear law), this give realism when planet is closed, smooth mouvement
67
+ when spaceship is far away of all planet.
68
+
69
+ Requirement
70
+ ===========
71
+
72
+ Git,Ruby, gosu
73
+
74
+ ```
75
+ install ruby 1.9.X
76
+ > gem install ang
77
+ > ang
78
+
79
+ or
80
+ > git clone http://github.com/raubarede/ang.git
81
+ > cd ang
82
+ > ruby main.rb
83
+ > cd net
84
+ > ruby multicast_test.rb &
85
+ > ruby agent.rb
86
+ ```
@@ -0,0 +1,228 @@
1
+ # Creative Commons BY-SA : Regis d'Aubarede <regis.aubarede@gmail.com>
2
+ # LGPL
3
+ #################################################################
4
+ # Rakefile : git commit/add ; git push, test/spec & gem push
5
+ #################################################################
6
+ #
7
+ # Usage:
8
+ # > rake commit # commit in local directory and push to repository
9
+ # > rake gem # make gem,and test it, and push it to gemcutter
10
+ #
11
+ #################################################################
12
+ # Requirements :
13
+ # version : X.Y.Z
14
+ # X : to be hand-modified
15
+ # Y : incremented at each 'rake gem'
16
+ # Z : increment on each file 'rake commit'
17
+ # auto commit all changed file, sking comment for each
18
+ # log all commment in CHANGELOG?Txt file
19
+ # increment VERSION content with version numbering rule
20
+ # so CHANGELOG.txt is updated with each comment/version change
21
+ # so VERSION is updated in each commit (Z part) and each gem build (Y part)
22
+ #
23
+ # commit:
24
+ # Use 'git status' output for each new/modified file,
25
+ # with asking some comment
26
+ # (no add/commit of comment is empty)
27
+ #
28
+ # gem:
29
+ # execute rspec if specs exists,
30
+ # make a gem, install it, execute samples/test.rb in it, if exist
31
+ # ask to operator if execution is ok and :
32
+ # increment version
33
+ # update change log/version
34
+ # do a 'gem push' and a 'gem yanked'
35
+ # make a coffe
36
+ #
37
+ #################################################################
38
+
39
+ FIGNORES=%w{net/essai.rb Rakefile.rb CHANGELOG.txt .gitignore}
40
+ FIGNORESREGEXP=[/\.gem$/]
41
+
42
+ NAME= Dir.pwd.gsub(File.dirname(Dir.pwd)+'/',"")
43
+
44
+ Rake.application.options.trace = false
45
+
46
+ def push_changelog(line)
47
+ b=File.read('CHANGELOG.txt').split(/\r?\n/)
48
+ b.unshift(line)
49
+ File.open('CHANGELOG.txt','w') {|f| f.write(b[0..500].join("\n")) }
50
+ end
51
+ def changelog_push_currrent_versions()
52
+ version=File.read('VERSION').strip
53
+ b=File.read('CHANGELOG.txt').split(/\r?\n/)
54
+ b.unshift(version)
55
+ File.open('CHANGELOG.txt','w') {|f| f.write(b.join("\n")) }
56
+ yield rescue p $!.to_s
57
+ b.shift
58
+ File.open('CHANGELOG.txt','w') {|f| f.write(b.join("\n")) }
59
+ end
60
+
61
+ def change_version()
62
+ a=File.read('VERSION').strip.split('.')[0..2]
63
+ yield(a)
64
+ version=a.join('.')
65
+ File.open('VERSION','w') {|f| f.write(version) }
66
+ version
67
+ end
68
+ def verification_file(fn)
69
+ return unless File.extname(fn)==".rb"
70
+ content=File.read(fn)[0..600]
71
+ unless content =~ /BY-SA/
72
+ puts "\nFile #{fn} seem not contain licenses data (BY-SA)\n"
73
+ exit(0)
74
+ end
75
+ end
76
+ #############################################################
77
+ # Comment each file add/modified ##
78
+ #############################################################
79
+
80
+
81
+ desc "commit file changed and created"
82
+ task :commit_status do
83
+ `git status -s`.split(/\r?\n/).each do |line|
84
+ words=line.split(/\s+/)
85
+ case line
86
+ when /^ M /
87
+ filename=words[2]
88
+ next if FIGNORES.include?(filename)
89
+ next if FIGNORESREGEXP.any? { |re| filename =~ re }
90
+ system("git","diff",filename)
91
+ print("Comment for change in #{filename} : ")
92
+ comment=$stdin.gets
93
+ if comment && comment.chomp.size>0
94
+ comment.chomp!
95
+ (puts "Abort!";exit!) if comment=~/^a(b(o(r(t)?)?)?)?$/
96
+ verification_file(filename)
97
+ sh "git commit #{filename} -m \"#{comment.strip}\"" rescue 1
98
+ push_changelog(" #{File.basename(filename)} : #{comment}")
99
+ $changed=true
100
+ end
101
+ when /^\?\?/
102
+ filename=words[1]
103
+ next if FIGNORES.include?(filename)
104
+ next if FIGNORESREGEXP.any? { |re| filename =~ re }
105
+ print("Comment for new file in #{filename} : ")
106
+ comment=$stdin.gets.chomp
107
+ (puts "Abort!";exit!) if comment=~/^a(b(o(r(t)?)?)?)?$/
108
+ if comment =~ /^y|o/i
109
+ verification_file(filename)
110
+ sh "git add #{filename}"
111
+ sh "git commit #{filename} -m \"creation\"" rescue 1
112
+ $changed=true
113
+ end
114
+ end
115
+ end
116
+ end
117
+
118
+
119
+ #############################################################
120
+ # before commit
121
+ #############################################################
122
+
123
+ desc "job before commit"
124
+ task :pre_commit do
125
+ sh "cls" if RUBY_PLATFORM =~ /(win32)|(mingw)/i
126
+ puts <<EEND2
127
+
128
+
129
+ --------------------------------------------------------------------
130
+ Commmit and push #{NAME}
131
+ --------------------------------------------------------------------
132
+ EEND2
133
+
134
+ #sh "giti"
135
+ $changed=false
136
+ end
137
+
138
+ #############################################################
139
+ # after commit
140
+ #############################################################
141
+ desc "job after local commit done: push to git repo"
142
+ task :post_commit do
143
+ if $changed
144
+ $version=change_version { |a| a[-1]=(a.last.to_i+1) }
145
+ sh "git commit VERSION -m update"
146
+ changelog_push_currrent_versions {
147
+ sh "git commit CHANGELOG.txt -m update"
148
+ sh "git push"
149
+ puts "\n\nNew version is #{$version}\n"
150
+ }
151
+ else
152
+ puts "no change!"
153
+ end
154
+ end
155
+
156
+ #############################################################
157
+ # commit
158
+ #############################################################
159
+ desc "commit local and then distant repo"
160
+ task :commit => [:pre_commit,"commit_status",:post_commit]
161
+
162
+
163
+ #############################################################
164
+ # gem build & push
165
+ #############################################################
166
+ desc "make a gem and push it to gemcutter"
167
+ task :gem => :commit do
168
+ puts <<EEND
169
+
170
+
171
+ --------------------------------------------------------------------
172
+ make gem, test it localy, and push gem #{NAME} to gemcutter
173
+ --------------------------------------------------------------------
174
+ EEND
175
+ $version=change_version { |a|
176
+ a[-2]=(a[-2].to_i+1)
177
+ a[-1]=0
178
+ }
179
+ puts "New version ==>> #{$version}"
180
+ l=FileList['*.gem']
181
+ l.each { |fn| rm fn }
182
+ gem_name="#{NAME}-#{$version}.gem"
183
+ push_changelog "#{$version} : #{Time.now}"
184
+ sh "gem build #{NAME}.gemspec"
185
+ Rake::Task["test"].execute if File.exists?("samples/test.rb")
186
+ sh "gem push #{gem_name}"
187
+ l.each { |fn|
188
+ ov=fn.split('-')[1].gsub('.gem',"")
189
+ sh "gem yank -v #{ov} #{NAME}"
190
+ }
191
+ end
192
+ #############################################################
193
+ # execute tests
194
+ #############################################################
195
+
196
+ desc "test the current version of the framework by installing the gem and run a test programme"
197
+ task :test do
198
+ if File.exists?("spec/test_all.rb")
199
+ system("rspec spec/test_all.rb")
200
+ end
201
+ if File.exists?("samples/test.rb")
202
+ cd ".."
203
+ mkdir "#{NAME}Test" unless File.exists?("#{NAME}Test")
204
+ nname="#{NAME}Test/test.rb"
205
+ content=File.read("#{NAME}/samples/test.rb").gsub(/^\s*require_relative/,"require").gsub('../lib/','')
206
+ File.open(nname,"w") { |f| f.write(content) }
207
+ sh "gem install #{FileList["#{NAME}/#{NAME}*.gem"][-1]}"
208
+ ruby nname
209
+ cd NAME
210
+ print "\n\nOk for diffusion ? "
211
+ rep=$stdin.gets
212
+ raise("aborted!") unless rep && rep =~ /^y|o|d/
213
+ end
214
+ end
215
+
216
+ #############################################################
217
+ # travis command
218
+ #############################################################
219
+
220
+ task :travis do
221
+ puts "Starting travis test..."
222
+ cmd="bundle exec rspec spec/test_all.rb"
223
+ system("export DISPLAY=:99.0 && #{cmd}")
224
+ #system(cmd)
225
+ raise "rspec failed!" unless $?.exitstatus == 0
226
+ end
227
+
228
+
Binary file
Binary file
Binary file
Binary file
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 9.19.0
@@ -0,0 +1,48 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "ang"
5
+ s.version = File.read("VERSION").strip
6
+ s.date = Time.now.to_s.split(/\s+/)[0]
7
+ s.email = "regis.aubarede@gmail.com"
8
+ s.homepage = "http://github.com/raubarede/ang"
9
+ s.authors = ["Regis d'Aubarede"]
10
+ s.summary = "A 2D planetoid navigation game"
11
+ s.description = <<EEND
12
+ Intersideral navigation
13
+ EEND
14
+
15
+ dependencies = [
16
+ [:runtime, "gosu"],
17
+ ]
18
+
19
+ s.files = Dir['**/*']
20
+ s.executables = ["ang","angm"]
21
+ s.bindir = "bin"
22
+
23
+
24
+ ## Make sure you can build the gem on older versions of RubyGems too:
25
+ s.rubygems_version = "1.8.15"
26
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
27
+ s.specification_version = 3 if s.respond_to? :specification_version
28
+
29
+ dependencies.each do |type, name, version|
30
+ if s.respond_to?("add_#{type}_dependency")
31
+ s.send("add_#{type}_dependency", name, version)
32
+ else
33
+ s.add_dependency(name, version)
34
+ end
35
+ end
36
+ s.post_install_message = <<TTEXT
37
+
38
+ -------------------------------------------------------------------------------
39
+
40
+ Hello, welcome to ang game....
41
+
42
+ $ ang # simple easy training
43
+ $ angm # multi gamer, harder
44
+
45
+ -------------------------------------------------------------------------------
46
+ TTEXT
47
+ end
48
+