woodcutter_story 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/bin/woodcutter +6 -0
- data/lib/woodcutter_story.rb +487 -0
- data/lib/woodcutter_story/images/apple.png +0 -0
- data/lib/woodcutter_story/images/backpack.png +0 -0
- data/lib/woodcutter_story/images/bee.png +0 -0
- data/lib/woodcutter_story/images/butterfly.png +0 -0
- data/lib/woodcutter_story/images/cabin.png +0 -0
- data/lib/woodcutter_story/images/castle.png +0 -0
- data/lib/woodcutter_story/images/cave1.png +0 -0
- data/lib/woodcutter_story/images/donkey.png +0 -0
- data/lib/woodcutter_story/images/fish.png +0 -0
- data/lib/woodcutter_story/images/flask.png +0 -0
- data/lib/woodcutter_story/images/fox.png +0 -0
- data/lib/woodcutter_story/images/frog.png +0 -0
- data/lib/woodcutter_story/images/hearts.png +0 -0
- data/lib/woodcutter_story/images/help.png +0 -0
- data/lib/woodcutter_story/images/maze.png +0 -0
- data/lib/woodcutter_story/images/mouse.png +0 -0
- data/lib/woodcutter_story/images/next.png +0 -0
- data/lib/woodcutter_story/images/not_help.png +0 -0
- data/lib/woodcutter_story/images/onion.png +0 -0
- data/lib/woodcutter_story/images/play.png +0 -0
- data/lib/woodcutter_story/images/question.png +0 -0
- data/lib/woodcutter_story/images/rabbit.png +0 -0
- data/lib/woodcutter_story/images/rain.png +0 -0
- data/lib/woodcutter_story/images/rooster.png +0 -0
- data/lib/woodcutter_story/images/rope.png +0 -0
- data/lib/woodcutter_story/images/ruby.png +0 -0
- data/lib/woodcutter_story/images/slingshot.png +0 -0
- data/lib/woodcutter_story/images/snail.png +0 -0
- data/lib/woodcutter_story/images/snowdrop.png +0 -0
- data/lib/woodcutter_story/images/spider.png +0 -0
- data/lib/woodcutter_story/images/squirrel.png +0 -0
- data/lib/woodcutter_story/images/start_over.png +0 -0
- data/lib/woodcutter_story/images/sun.png +0 -0
- data/lib/woodcutter_story/images/sunflower.png +0 -0
- data/lib/woodcutter_story/images/torch1.png +0 -0
- data/lib/woodcutter_story/images/woodcuter.png +0 -0
- data/lib/woodcutter_story/version.rb +3 -0
- data/woodcutter_story.gemspec +34 -0
- metadata +151 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c3cd91e1853ea7aaf1c8b7249e3b6d45b3acfc70
|
4
|
+
data.tar.gz: c415fc04ed10bcd62d7d84a8dcc37810f3fa089a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b368c1b4e82f76ebef5aca1058f9192c52af68f8d682387cd5a43b8b67bff8fd7aa0e9d3f8f832237e5b768d0f5da0c76ae96f61867199b1b4c40ab6e0a67940
|
7
|
+
data.tar.gz: 47ff311558c19516e234be3dcb81b66adc8e35a35b1e9e2d06829d4d843a2fa8ed7b8289adc28d4056c6cd129c9b487adf1730e81c9936b51c372ef351e5f48c
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Sebastjan Hribar
|
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
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
# WoodcutterStory
|
2
|
+
|
3
|
+
This is a decision driven story in Slovenian.
|
4
|
+
|
5
|
+
Image sources:
|
6
|
+
|
7
|
+
Own drawings: slingshot, torch, flask, help, not_help, play, start_over
|
8
|
+
|
9
|
+
All other images: Open Clip Art Library (http://openclipart.org/)
|
10
|
+
|
11
|
+
Riddles:
|
12
|
+
|
13
|
+
All riddles are taken from
|
14
|
+
http://sl.wikisource.org/wiki/Uganke_%28Mira_Voglar%29.
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
gem 'woodcutter_story'
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install woodcutter_story
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
Runing the application
|
35
|
+
Windows
|
36
|
+
|
37
|
+
- Navigate to c:\my\installation\folder\woodcutter_story\lib\woodcutter_story.rb and double click
|
38
|
+
|
39
|
+
or
|
40
|
+
|
41
|
+
- Run from the command line: woodcutter
|
42
|
+
|
43
|
+
Linux
|
44
|
+
|
45
|
+
- Run from the command line: woodcutter
|
46
|
+
|
47
|
+
Usage
|
48
|
+
|
49
|
+
See instructions in the application.
|
50
|
+
|
51
|
+
## Development
|
52
|
+
|
53
|
+
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.
|
54
|
+
|
55
|
+
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).
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/woodcutter_story. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
60
|
+
|
61
|
+
|
62
|
+
## License
|
63
|
+
|
64
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
65
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "woodcutter_story"
|
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
|
data/bin/setup
ADDED
data/bin/woodcutter
ADDED
@@ -0,0 +1,487 @@
|
|
1
|
+
require_relative "woodcutter_story/version"
|
2
|
+
|
3
|
+
#encoding: utf-8
|
4
|
+
require 'nkf'
|
5
|
+
require 'green_shoes'
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
class Woodcutter < Shoes
|
10
|
+
url '/', :index
|
11
|
+
url '/prologue', :prologue
|
12
|
+
url '/departure', :departure
|
13
|
+
url '/cave', :cave
|
14
|
+
url '/oval_chamber', :oval_chamber
|
15
|
+
url '/maze', :maze
|
16
|
+
url '/maze_travel', :maze_travel
|
17
|
+
url '/ending', :ending
|
18
|
+
|
19
|
+
@@backpack = []
|
20
|
+
|
21
|
+
# The index page
|
22
|
+
def index
|
23
|
+
background antiquewhite
|
24
|
+
stack margin: 20 do
|
25
|
+
@@backpack.clear
|
26
|
+
title "Pustolovščina mladega gozdarja".upcase, :align => "center"
|
27
|
+
image "woodcutter_story/images/woodcuter.png", height: 350, width: 350, center: true
|
28
|
+
|
29
|
+
flow do
|
30
|
+
image "woodcutter_story/images/question.png", margin: 20, height: 100, width: 100, :click => proc {
|
31
|
+
window title: "Navodila", margin: 35, width: 700, height: 800 do
|
32
|
+
background antiquewhite
|
33
|
+
title "Navodila".upcase, :align => "center"
|
34
|
+
|
35
|
+
para "1.\tPred teboj je zgodba o pustolovščini mladega gozdarja.
|
36
|
+
\tTvoja naloga je, da mu pomagaš osvojiti princesko.
|
37
|
+
\tS kliki na sličice pomagaš gozdarju na njegovi poti.
|
38
|
+
|
39
|
+
2.\tna njegovi poti mu lahk pomagaš pri različnih odločitvah, tako da
|
40
|
+
\tklikneš na različne sličice.
|
41
|
+
|
42
|
+
3.\tS kliki na puščice se pomikaš med posameznimi poglavji pravljice.
|
43
|
+
|
44
|
+
4.\tLegenda sličic:".upcase
|
45
|
+
|
46
|
+
flow do
|
47
|
+
stack margin: 5, width: 200, height: 200 do
|
48
|
+
border red, strokewidth: 3
|
49
|
+
image "woodcutter_story/images/question.png", margin: 20, height: 80, width: 80
|
50
|
+
caption "Navodila".upcase
|
51
|
+
end
|
52
|
+
|
53
|
+
stack margin: 5, width: 200, height: 200 do
|
54
|
+
border red, strokewidth: 3
|
55
|
+
image "woodcutter_story/images/help.png", margin: 20, height: 80, width: 80
|
56
|
+
caption "Pomaga nekomu".upcase
|
57
|
+
end
|
58
|
+
|
59
|
+
stack margin: 5, width: 200, height: 200 do
|
60
|
+
border red, strokewidth: 3
|
61
|
+
image "woodcutter_story/images/not_help.png", margin: 20, height: 80, width: 80
|
62
|
+
caption "Ne pomaga".upcase
|
63
|
+
end
|
64
|
+
|
65
|
+
stack margin: 5, width: 200, height: 200 do
|
66
|
+
border red, strokewidth: 3
|
67
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 80, width: 80
|
68
|
+
caption "Naslednje poglavje".upcase
|
69
|
+
end
|
70
|
+
|
71
|
+
stack margin: 5, width: 200, height: 200 do
|
72
|
+
border red, strokewidth: 3
|
73
|
+
image "woodcutter_story/images/start_over.png", margin: 20, height: 80, width: 80
|
74
|
+
caption "Ponovno začni dogodivščino".upcase
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
}
|
80
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
81
|
+
visit '/prologue'}
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# First chapter
|
87
|
+
def prologue
|
88
|
+
flow do
|
89
|
+
subtitle "Mladi gozdar".upcase, :align => "center", margin: 20
|
90
|
+
background antiquewhite
|
91
|
+
stack margin: 20 do
|
92
|
+
para "Nekoč je živel mlad gozdar, ki je bil zaljubljen v princesko
|
93
|
+
njegovega kraljestva. Videl jo je samo od daleč, na sejmih,
|
94
|
+
ki so jih prirejali na gradu, kjer je prodajal svoje izdelke
|
95
|
+
iz lesa.".upcase, :align => "center"
|
96
|
+
|
97
|
+
image "woodcutter_story/images/castle.png", height: 350, width: 350, center: true
|
98
|
+
|
99
|
+
para "O tem, da bi jo obiskal in se z njo pogovarjal, je lahko
|
100
|
+
samo sanjal, saj je bil le navaden gozdar in ne princ. Ni pa vedel, da je tudi
|
101
|
+
princeska opazila njega.
|
102
|
+
|
103
|
+
Živel je v koči sredi gozda, kjer je prebil večino svojega časa,
|
104
|
+
zaposlen s sekanjem dreves in drugimi gozdnimi opravili.".upcase, :align => "center"
|
105
|
+
|
106
|
+
image "woodcutter_story/images/cabin.png", height: 350, width: 350, center: true
|
107
|
+
|
108
|
+
para "Ko se je nekoč vračal domov, se je ustavil v bližnji krčmi. Tam je
|
109
|
+
slišal, kako so se pogovarjali o skrivnostnem zakladu, ki naj bi bil
|
110
|
+
skrit v strašnem podzemnem labirintu. Takrat je dobil idejo: če bi
|
111
|
+
našel zaklad in se s tem dokazal, bi mu kralj gotovo dovolil
|
112
|
+
obiskati princesko.
|
113
|
+
|
114
|
+
V krčmi je izvedel, da se podzemni labirint nahaja pod goro, ki je
|
115
|
+
od njegovega doma oddaljena 3 dni hoda.".upcase, :align => "center"
|
116
|
+
|
117
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
118
|
+
visit '/departure'}
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Second chapter
|
124
|
+
def departure
|
125
|
+
background antiquewhite
|
126
|
+
flow do
|
127
|
+
subtitle "Odhod od doma".upcase, :align => "center", margin: 20
|
128
|
+
background antiquewhite
|
129
|
+
departure_stack = stack margin: 20 do
|
130
|
+
|
131
|
+
para "Gozdar se je odločil, da bo poskusil poiskati zaklad.
|
132
|
+
Preden pa se odpravi na pot, mu pomagaj izbrati stvari,
|
133
|
+
ki jih bo vzel s seboj, da bo lažje našel zaklad.
|
134
|
+
V nahrbtniku ima prostor za 3 predmete. Izberi tiste 3, ki naj
|
135
|
+
jih vzame s seboj.".upcase, :align => "center"
|
136
|
+
|
137
|
+
|
138
|
+
# Items to take on the adventure
|
139
|
+
apple = "woodcutter_story/images/apple.png"
|
140
|
+
water = "woodcutter_story/images/flask.png"
|
141
|
+
torch = "woodcutter_story/images/torch1.png"
|
142
|
+
rope = "woodcutter_story/images/rope.png"
|
143
|
+
slingshot = "woodcutter_story/images/slingshot.png"
|
144
|
+
|
145
|
+
images_items = [apple, water, torch, rope, slingshot]
|
146
|
+
|
147
|
+
para "***".upcase, :align => "center"
|
148
|
+
caption "Pomagaj gozdarju izbrati vse, kar bo potreboval na poti.".upcase, :align => "center"
|
149
|
+
para "***".upcase, :align => "center"
|
150
|
+
|
151
|
+
para "1. jabolko \t2. voda 3. bakla \t4. vrv \t5. frača".upcase
|
152
|
+
flow do
|
153
|
+
background antiquewhite
|
154
|
+
images_items.each do
|
155
|
+
|i| image i, margin: 10, height: 80, width: 80, :click => proc {
|
156
|
+
if @@backpack.include? i
|
157
|
+
alert ("Ta predmet je že v nahrbtniku!".upcase)
|
158
|
+
elsif @@backpack.length >= 3
|
159
|
+
alert ("Nahrbtnik je že poln.".upcase)
|
160
|
+
else
|
161
|
+
@@backpack << i
|
162
|
+
end
|
163
|
+
}
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
para "Nahrbtnik".upcase
|
168
|
+
@backpack_clicked = false
|
169
|
+
image "woodcutter_story/images/backpack.png", margin: 10, height: 80, width: 80, :click => proc {
|
170
|
+
|
171
|
+
if @@backpack.length == 0
|
172
|
+
alert ("Nahrbtnik je prazen".upcase)
|
173
|
+
else
|
174
|
+
if @backpack_clicked == false
|
175
|
+
departure_stack.append {flow do
|
176
|
+
background antiquewhite
|
177
|
+
border red, strokewidth: 3
|
178
|
+
@@backpack.each { |i| image i, margin: 10, height: 80, width: 80}
|
179
|
+
end
|
180
|
+
}
|
181
|
+
@backpack_clicked = true
|
182
|
+
else
|
183
|
+
alert ("Nahrbtnik je že odprt").upcase
|
184
|
+
end
|
185
|
+
end
|
186
|
+
}
|
187
|
+
end
|
188
|
+
end
|
189
|
+
flow do
|
190
|
+
background antiquewhite
|
191
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
192
|
+
visit '/cave'}
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
# Third chapter
|
197
|
+
def cave
|
198
|
+
background antiquewhite
|
199
|
+
flow do
|
200
|
+
subtitle "Jama z labirintom".upcase, :align => "center", margin: 10
|
201
|
+
background antiquewhite
|
202
|
+
stack margin: 10 do
|
203
|
+
|
204
|
+
para "Po treh dneh hoda je prišel do gore z labirintom in do vhoda v jamo.".upcase, :align => "center"
|
205
|
+
|
206
|
+
image "woodcutter_story/images/cave1.png", height: 350, width: 350, center: true
|
207
|
+
|
208
|
+
if @@backpack.any? {|item| item =~ /torch/}
|
209
|
+
para "Notranjost jame je bila zavita v temo. Gozdar ni videl niti
|
210
|
+
enega metra pred seboj. Še dobro, da je s seboj vzel baklo.
|
211
|
+
Prižgal jo je in vstopil v jamo. Po dobri uri hoje je prišel do
|
212
|
+
strmega spusta navzdol.".upcase, :align => "center"
|
213
|
+
|
214
|
+
if @@backpack.any? {|item| item =~ /rope/}
|
215
|
+
para "Ker je vzel s seboj vrv, se je odločil,
|
216
|
+
da se bo poskusil po strmini spustiti kar s pomočjo vrvi.
|
217
|
+
Privezal jo je na skalo in vrgel po strmini.
|
218
|
+
Po 15 minutah je dosegel dno. Šele zdaj je videl,
|
219
|
+
da je v veliki ovalni dvorani.".upcase, :align => "center"
|
220
|
+
|
221
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
222
|
+
visit '/oval_chamber'}
|
223
|
+
|
224
|
+
else
|
225
|
+
para "Ker ni imel vrvi, je moral ubrati drugo pot.
|
226
|
+
Odločil se je, da bo poskusil zaobiti strmino po levi
|
227
|
+
strani. Spustil se je v ozek rov z veliko zavoji.
|
228
|
+
Na koncu ga je čakal majhen prostor, ki se je razdelil na tri hodnike.
|
229
|
+
Prišel je do vhoda v labirint!".upcase, :align => "center"
|
230
|
+
|
231
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
232
|
+
visit '/maze'}
|
233
|
+
|
234
|
+
end
|
235
|
+
else
|
236
|
+
para "Notranjost jame je bila zavita v temo. Gozdar ni
|
237
|
+
videl niti enega metra pred seboj. Ker ni vzel bakle,
|
238
|
+
je v jamo vstopil v temi. Nekaj časa je taval v temi,
|
239
|
+
potem pa je spoznal, da brez bakle ne more naprej.
|
240
|
+
Odločil se je, da se gre domov, da se ne bi za vedno
|
241
|
+
izgubil v jami.".upcase, :align => "center"
|
242
|
+
|
243
|
+
image "woodcutter_story/images/start_over.png", margin: 20, height: 100, width: 100, :click => proc {
|
244
|
+
visit '/'}
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# Fourth chapter - oval chamber
|
251
|
+
def oval_chamber
|
252
|
+
background antiquewhite
|
253
|
+
flow do
|
254
|
+
subtitle "Ovalna dvorana".upcase, :align => "center", margin: 20
|
255
|
+
background antiquewhite
|
256
|
+
stack margin: 20 do
|
257
|
+
|
258
|
+
para "Začel je raziskovati ovalno dvorano. Kmalu je prišel do
|
259
|
+
nekakšnih velikih kamnitih vrat. Približal se je, da bi
|
260
|
+
jih poskušal odpreti, ko je na vratih prebral naslednje besedilo.
|
261
|
+
|
262
|
+
Če hočeš priti do zaklada, moraš rešiti naslednjo uganko.
|
263
|
+
Na vratih je bila izpisana uganka, pod njo pa so bili nekakšni kamniti
|
264
|
+
gumbi, ki so predstavljali rešitve. Izbrati mora pravo.".upcase, :align => "center"
|
265
|
+
|
266
|
+
|
267
|
+
riddles = {
|
268
|
+
1 => "V vodi živi, žabica ni. Brez rok brez nog plava naokrog.",
|
269
|
+
2 => "Zemljico žejno zaliva, strehe in ceste pomiva. Žaba veselo kriči: Oj, le še padaj, tri dni!",
|
270
|
+
3 => "Uhlji dolgi, zajec ni! Tovor nosi, polžek ni! Kadar najbolj se mudi, trmoglavo obstoji.",
|
271
|
+
4 => "Zjutraj vstaja, zvečer zahaja.",
|
272
|
+
5 => "Roža raste više, više, kakor sonce se ti zdi. Ko nje seme dozori, rada ptičke pogosti!",
|
273
|
+
6 => "Dolgouhec potepuhec venomer skaklja sem in tja sem in tja.",
|
274
|
+
7 => "Z repom košatim mahlja, z veje na vejo skaklja.",
|
275
|
+
8 => "Smrček privihan, rep pa košat. Pravi, da pojde h kuricam spat. Zjutraj pa kuric ni na dvorišče, perje ostalo je le za prgišče. Kurice vzela je drzna tatica, v gozdu jih snela je zvita:",
|
276
|
+
9 => "Zelene so njene hlače. Še više kot bolha skače. Za dom ji je blatna mlaka. Ponoči pa glasno kvaka",
|
277
|
+
10 => "Majhen je, drobán, a tako močan kakor nihče drug. Brez vsakih muk hišo si oprta. Glej ga! – Sredi vrat.",
|
278
|
+
11 => "V kotu pod stropom ribič preži, v mrežo prav tanko nekaj lovi. Pa kaj? Saj ribic tu ni! O, pa so muhe debele in suhe, te on lovi.",
|
279
|
+
12 => "Na gnoju stoji, za putke skrbi, ko se zdani, se oglasi: kikiriki",
|
280
|
+
13 => "Spomladi se prvi zbudi, z glavico belo neslišno zvoni.",
|
281
|
+
14 => "Od jutra do noči hiti, hiti, hiti. Spušča s cveta se na cvet in nabira sladki med.",
|
282
|
+
15 => "Pisana krila se v soncu bleščijo, ko se po zraku lovijo. Pisana krila se v soncu bleščijo, ko se na rože spustijo.",
|
283
|
+
}
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
@riddle = rand(1..15)
|
288
|
+
puts @riddle
|
289
|
+
subtitle "***", :align => "center"
|
290
|
+
caption riddles[@riddle].upcase, :align => "center"
|
291
|
+
subtitle "***", :align => "center"
|
292
|
+
|
293
|
+
fish = "woodcutter_story/images/fish.png"
|
294
|
+
rain = "woodcutter_story/images/rain.png"
|
295
|
+
donkey = "woodcutter_story/images/donkey.png"
|
296
|
+
sun = "woodcutter_story/images/sun.png"
|
297
|
+
sunflower = "woodcutter_story/images/sunflower.png"
|
298
|
+
rabbit = "woodcutter_story/images/rabbit.png"
|
299
|
+
squirrel = "woodcutter_story/images/squirrel.png"
|
300
|
+
fox = "woodcutter_story/images/fox.png"
|
301
|
+
frog = "woodcutter_story/images/frog.png"
|
302
|
+
snail = "woodcutter_story/images/snail.png"
|
303
|
+
spider = "woodcutter_story/images/spider.png"
|
304
|
+
rooster = "woodcutter_story/images/rooster.png"
|
305
|
+
snowdrop = "woodcutter_story/images/snowdrop.png"
|
306
|
+
bee = "woodcutter_story/images/bee.png"
|
307
|
+
butterfly = "woodcutter_story/images/butterfly.png"
|
308
|
+
|
309
|
+
images_riddle = {1 => fish, 2 => rain, 3 => donkey, 4 => sun, 5 => sunflower,
|
310
|
+
6 => rabbit, 7 => squirrel, 8 => fox, 9 => frog, 10 => snail,
|
311
|
+
11 => spider, 12 => rooster, 13 => snowdrop, 14 => bee, 15 => butterfly}
|
312
|
+
|
313
|
+
flow do
|
314
|
+
background antiquewhite
|
315
|
+
@riddle_clicked = false
|
316
|
+
images_riddle.each do
|
317
|
+
|k, i| image i, margin: 10, height: 80, width: 80, :click => proc {
|
318
|
+
if @riddle_clicked == false
|
319
|
+
@riddle_solution = k
|
320
|
+
|
321
|
+
#SOLVES_RIDDLE
|
322
|
+
if @riddle_solution == @riddle
|
323
|
+
append {
|
324
|
+
flow do
|
325
|
+
background antiquewhite
|
326
|
+
subtitle "***", :align => "center"
|
327
|
+
para "Velika kamnita vrata se odprejo in gozdar je na sredi majhne dvorane
|
328
|
+
na kamnitem podstavku zagledal velik rdeč rubin.".upcase, :align => "center"
|
329
|
+
|
330
|
+
image "woodcutter_story/images/ruby.png", height: 80, width: 80, center: true
|
331
|
+
|
332
|
+
para "Pospravil ga je v nahrbtnik in se odpravil domov.".upcase, :align => "center"
|
333
|
+
subtitle "***", :align => "center"
|
334
|
+
|
335
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
336
|
+
visit '/ending'}
|
337
|
+
end}
|
338
|
+
|
339
|
+
# DOESNT_SOLVE_RIDDLE
|
340
|
+
else
|
341
|
+
append {
|
342
|
+
flow do
|
343
|
+
background antiquewhite
|
344
|
+
subtitle "***", :align => "center"
|
345
|
+
para "Rešitev uganke ni bila pravilna. Okrog gozdarja se je pojavil bleščeč
|
346
|
+
obroč. Neznana čarobna moč ga je v trenutku iz ovalne dvorane
|
347
|
+
prenesla nazaj pred njegovo kočo.".upcase, :align => "center"
|
348
|
+
subtitle "***", :align => "center"
|
349
|
+
|
350
|
+
image "woodcutter_story/images/start_over.png", margin: 20, height: 100, width: 100, :click => proc {
|
351
|
+
visit '/'}
|
352
|
+
end}
|
353
|
+
@clicked = 0
|
354
|
+
end
|
355
|
+
else
|
356
|
+
alert ("Poskus za reševanje uganke si že porabil!").upcase
|
357
|
+
end
|
358
|
+
@riddle_clicked = true
|
359
|
+
}
|
360
|
+
end
|
361
|
+
end
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
365
|
+
|
366
|
+
# Maze
|
367
|
+
def maze
|
368
|
+
background antiquewhite
|
369
|
+
flow do
|
370
|
+
subtitle "Labirint".upcase, :align => "center", margin: 20
|
371
|
+
background antiquewhite
|
372
|
+
flow do
|
373
|
+
|
374
|
+
para "Ni vedel v kateri hodnik je pravi. Bal se je, da se bo za vedno izgubil.
|
375
|
+
Ravno, ko se je hotel obrniti in se vrniti, je zaslišal tiho
|
376
|
+
stokanje. Sledil je glasu in prišel do majhne vdolbine v eni izmed
|
377
|
+
sten, kjer je ležala majhna miška.
|
378
|
+
|
379
|
+
Rekla je: \"Prosim te, pomagaj mi.\"
|
380
|
+
Gozdar jo je vprašal: \"Kaj potrebuješ?\"
|
381
|
+
|
382
|
+
Miška mu je odgovorila, da že tri dni ni ničesar jedla ali pila in
|
383
|
+
je tako slabotna, da se ne more vrniti domov.".upcase, :align => "center"
|
384
|
+
|
385
|
+
para "***".upcase, :align => "center"
|
386
|
+
caption "Ali naj gozdar pomaga miški?".upcase, :align => "center"
|
387
|
+
para "***".upcase, :align => "center"
|
388
|
+
|
389
|
+
items = /flask|apple/
|
390
|
+
@decision = false
|
391
|
+
if @@backpack.any? {|item| item =~ items}
|
392
|
+
image "woodcutter_story/images/help.png", margin: 10, height: 80, width: 100, :click => proc {
|
393
|
+
background antiquewhite
|
394
|
+
if @decision == false
|
395
|
+
append {image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc { visit '/maze_travel'}}
|
396
|
+
@decision = true
|
397
|
+
else
|
398
|
+
alert ("Gozdar se je že odločil, nadaljuj s pustolovščino!").upcase
|
399
|
+
end
|
400
|
+
}
|
401
|
+
|
402
|
+
image "woodcutter_story/images/not_help.png", margin: 10, height: 80, width: 100, :click => proc {
|
403
|
+
background antiquewhite
|
404
|
+
if @decision == false
|
405
|
+
append { para "Gozdar se je odločil, da nima časa za pomoč miški. Poleg tega
|
406
|
+
bo morda sam kasneje potreboval hrano in pijačo. Miško je pustil tam,
|
407
|
+
kjer jo je našel in dejal, da ji bo pomagal, ko se bo vračal.
|
408
|
+
|
409
|
+
Ko je vstopil v labirint, ni našel več poti nazaj, pa tudi do
|
410
|
+
zaklada ni prišel. Za vedno se je izgubil. ".upcase, :align => "center"}
|
411
|
+
|
412
|
+
append {image "woodcutter_story/images/start_over.png", margin: 20, height: 100, width: 100, :click => proc {visit '/'}}
|
413
|
+
@decision = true
|
414
|
+
else
|
415
|
+
alert ("Gozdar se je že odločil, nadaljuj s pustolovščino!").upcase
|
416
|
+
end
|
417
|
+
}
|
418
|
+
else
|
419
|
+
para "Gozdar ni vzel s seboj ne jabolka in ne vode,
|
420
|
+
zato ni mogel pomagati miški.".upcase, :align => "center"
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
426
|
+
|
427
|
+
# Maze travel
|
428
|
+
def maze_travel
|
429
|
+
background antiquewhite
|
430
|
+
flow do
|
431
|
+
subtitle "Hoja po labirintu".upcase, :align => "center", margin: 20
|
432
|
+
background antiquewhite
|
433
|
+
stack margin: 20 do
|
434
|
+
para "Gozdar je pomagal miški in za nagrado se mu je usedla na rame
|
435
|
+
in ga vodila skozi zapleten labirint. Če bi sam poskušal priti
|
436
|
+
skozi, bi se zagotovo izgubil.
|
437
|
+
Ko sta prišla do ovalne dvorane, ga je miška pustila samega
|
438
|
+
in odšla nazaj k svoji družini.".upcase, :align => "center"
|
439
|
+
|
440
|
+
image "woodcutter_story/images/maze.png", height: 250, width: 250, center: true
|
441
|
+
|
442
|
+
image "woodcutter_story/images/next.png", margin: 20, height: 100, width: 100, :click => proc {
|
443
|
+
visit '/oval_chamber'}
|
444
|
+
end
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
448
|
+
|
449
|
+
# Ending
|
450
|
+
def ending
|
451
|
+
background antiquewhite
|
452
|
+
flow do
|
453
|
+
subtitle "In živela sta srečno...".upcase, :align => "center", margin: 20
|
454
|
+
background antiquewhite
|
455
|
+
stack margin: 20 do
|
456
|
+
para "Ko se je gozdar vrnil domov, je obiskal princesko na dvoru.
|
457
|
+
Kralj najprej ni dovolil, da bi gozdar videl princesko.
|
458
|
+
|
459
|
+
Ko pa mu je gozdar povedal o svoji pustolovščini in o zakladu,
|
460
|
+
se je kralj takoj premislil. V zameno za zaklad je dovolil,
|
461
|
+
da je šel gozdar obiskat princesko.
|
462
|
+
|
463
|
+
Princeska se je gozdarja zelo razveselila.".upcase, :align => "center"
|
464
|
+
|
465
|
+
image "woodcutter_story/images/hearts.png", height: 150, width: 150, center: true
|
466
|
+
|
467
|
+
para "Gozdar se je odločil, da bo kralja prosil za roko njegove hčere.
|
468
|
+
Bil je prepričan, da bo kralj privolil, saj je gozdar dokazal,
|
469
|
+
da je pogumen, pa tudi zaklad mu je prinesel.
|
470
|
+
|
471
|
+
Kralj pa se je razjezil in je dejal, da se nikoli ne bo smel poročiti s
|
472
|
+
princesko, ker ni princ, ampak navaden gozdar.
|
473
|
+
|
474
|
+
Ko je princeska to slišala, se je tudi ona razjezila. Kralju
|
475
|
+
je rekla, da je gozdar najbolj pogumen in bolj plemenit
|
476
|
+
kot vsi princi na svetu. Tako je zapustila grad in odšla
|
477
|
+
živet k gozdarju. Živela sta dolgo in srečno do konca svojih dni.".upcase, :align => "center"
|
478
|
+
|
479
|
+
image "woodcutter_story/images/start_over.png", margin: 20, height: 100, width: 100, :click => proc {visit '/'}
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
483
|
+
|
484
|
+
end
|
485
|
+
|
486
|
+
Shoes.app title: "Mladi gozdar", width: 800, height: 900
|
487
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'woodcutter_story/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "woodcutter_story"
|
8
|
+
spec.version = WoodcutterStory::VERSION
|
9
|
+
spec.authors = ["Sebastjan Hribar"]
|
10
|
+
spec.email = ["sebastjan.hribar@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Decision driven story in Slovenian.}
|
13
|
+
spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/sebastjan-hribar/woodcutter_story"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://rubygems.org'"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.executables = ["woodcutter"]
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_runtime_dependency "green_shoes", "=1.1.367"
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "minitest"
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: woodcutter_story
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sebastjan Hribar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: green_shoes
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.367
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.367
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: ''
|
70
|
+
email:
|
71
|
+
- sebastjan.hribar@gmail.com
|
72
|
+
executables:
|
73
|
+
- woodcutter
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- .travis.yml
|
79
|
+
- CODE_OF_CONDUCT.md
|
80
|
+
- Gemfile
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- bin/console
|
85
|
+
- bin/setup
|
86
|
+
- bin/woodcutter
|
87
|
+
- lib/woodcutter_story.rb
|
88
|
+
- lib/woodcutter_story/images/apple.png
|
89
|
+
- lib/woodcutter_story/images/backpack.png
|
90
|
+
- lib/woodcutter_story/images/bee.png
|
91
|
+
- lib/woodcutter_story/images/butterfly.png
|
92
|
+
- lib/woodcutter_story/images/cabin.png
|
93
|
+
- lib/woodcutter_story/images/castle.png
|
94
|
+
- lib/woodcutter_story/images/cave1.png
|
95
|
+
- lib/woodcutter_story/images/donkey.png
|
96
|
+
- lib/woodcutter_story/images/fish.png
|
97
|
+
- lib/woodcutter_story/images/flask.png
|
98
|
+
- lib/woodcutter_story/images/fox.png
|
99
|
+
- lib/woodcutter_story/images/frog.png
|
100
|
+
- lib/woodcutter_story/images/hearts.png
|
101
|
+
- lib/woodcutter_story/images/help.png
|
102
|
+
- lib/woodcutter_story/images/maze.png
|
103
|
+
- lib/woodcutter_story/images/mouse.png
|
104
|
+
- lib/woodcutter_story/images/next.png
|
105
|
+
- lib/woodcutter_story/images/not_help.png
|
106
|
+
- lib/woodcutter_story/images/onion.png
|
107
|
+
- lib/woodcutter_story/images/play.png
|
108
|
+
- lib/woodcutter_story/images/question.png
|
109
|
+
- lib/woodcutter_story/images/rabbit.png
|
110
|
+
- lib/woodcutter_story/images/rain.png
|
111
|
+
- lib/woodcutter_story/images/rooster.png
|
112
|
+
- lib/woodcutter_story/images/rope.png
|
113
|
+
- lib/woodcutter_story/images/ruby.png
|
114
|
+
- lib/woodcutter_story/images/slingshot.png
|
115
|
+
- lib/woodcutter_story/images/snail.png
|
116
|
+
- lib/woodcutter_story/images/snowdrop.png
|
117
|
+
- lib/woodcutter_story/images/spider.png
|
118
|
+
- lib/woodcutter_story/images/squirrel.png
|
119
|
+
- lib/woodcutter_story/images/start_over.png
|
120
|
+
- lib/woodcutter_story/images/sun.png
|
121
|
+
- lib/woodcutter_story/images/sunflower.png
|
122
|
+
- lib/woodcutter_story/images/torch1.png
|
123
|
+
- lib/woodcutter_story/images/woodcuter.png
|
124
|
+
- lib/woodcutter_story/version.rb
|
125
|
+
- woodcutter_story.gemspec
|
126
|
+
homepage: https://github.com/sebastjan-hribar/woodcutter_story
|
127
|
+
licenses:
|
128
|
+
- MIT
|
129
|
+
metadata:
|
130
|
+
allowed_push_host: 'TODO: Set to ''http://rubygems.org'''
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - '>='
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 2.0.14
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: Decision driven story in Slovenian.
|
151
|
+
test_files: []
|