gamefic-sdk 3.0.0 → 3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +40 -28
- data/lib/gamefic-sdk/version.rb +3 -1
- data/scaffolds/project/README.md.gf.erb +1 -1
- data/scaffolds/project/__name__/subplot.rb.gf.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d90eb96a94149551b573259fd78410c1f0332b0a5ecaa9d559cc091a8962629
|
4
|
+
data.tar.gz: 4547e88ec7f62bcbe08d60d6411461327d1ff9f27c50755c47135c98cb4b1806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '01081048d9c32716574e9ff9d906ee03cf07259875d608ea36fb73bea310440d43760c4d12f8e33159dfc346b31a33bf5eabf50c042c06bb169204aa5f8d98c4'
|
7
|
+
data.tar.gz: 6fadb23c6b9cfeeb855bfb082a932ae6abde7c722ebb194d20b3902900d8c50b679ce52e4205a04d6ac7544386e8c41baa47587d7323f9cfa9157ff43c8ea8f1
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
## 3.0.1 - April 10, 2024
|
2
|
+
- Updates to README in project scaffold
|
3
|
+
|
1
4
|
## 3.0.0 - January 27, 2024
|
2
5
|
- Deprecate broken/redundant commands
|
3
6
|
- Improved serialization
|
4
7
|
- Queries use proxies for static entities
|
5
8
|
- All scripted blocks get evaluated on stage
|
6
|
-
- Use
|
9
|
+
- Use react-gamefic for web scaffolds
|
7
10
|
- Modular projects and libraries
|
8
11
|
- New project scaffold
|
9
12
|
|
data/README.md
CHANGED
@@ -37,21 +37,26 @@ so there's not much to do yet. Enter `QUIT` to exit the game.
|
|
37
37
|
|
38
38
|
### The Script Code
|
39
39
|
|
40
|
-
The
|
41
|
-
|
40
|
+
The plot for your narrative is defined in the `plot.rb` file. It should look
|
41
|
+
something like this:
|
42
42
|
|
43
43
|
```ruby
|
44
|
-
|
45
|
-
|
44
|
+
module Example
|
45
|
+
class Plot < Gamefic::Plot
|
46
|
+
UUID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
|
46
47
|
|
47
|
-
Gamefic
|
48
|
-
|
49
|
-
|
48
|
+
include Gamefic::Standard
|
49
|
+
|
50
|
+
script do
|
51
|
+
introduction do |actor|
|
52
|
+
actor.tell "Hello, world!"
|
53
|
+
end
|
54
|
+
end
|
50
55
|
end
|
51
56
|
end
|
52
57
|
```
|
53
58
|
|
54
|
-
`
|
59
|
+
`UUID` is a globally unique identifier. It can be useful if you want to
|
55
60
|
add your game to online catalogs, such as the [Interactive Fiction Database](https://ifdb.tads.org/),
|
56
61
|
but it's safe to delete if you don't need it.
|
57
62
|
|
@@ -61,26 +66,34 @@ developers should find it similar to Inform's Standard Rules. It defines common
|
|
61
66
|
components like Rooms and Characters, along with in-game commands like `GO`,
|
62
67
|
`GET`, and `DROP` to enable basic interactivity.
|
63
68
|
|
64
|
-
`
|
69
|
+
`script` is where you write the story itself. In the starter project,
|
65
70
|
the only thing in the script is an introductory message.
|
66
71
|
|
67
72
|
### Modifying the Script
|
68
73
|
|
69
|
-
Replace the contents of `
|
74
|
+
Replace the contents of `plot.rb` with the following:
|
70
75
|
|
71
76
|
```ruby
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
77
|
+
module Example
|
78
|
+
class Plot < Gamefic::Plot
|
79
|
+
UUID = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
|
80
|
+
|
81
|
+
include Gamefic::Standard
|
82
|
+
|
83
|
+
seed do
|
84
|
+
@living_room = make Room, name: 'living room', description: 'This is your living room.'
|
85
|
+
@bedroom = make Room, name: 'bedroom', description: 'This is your bedroom.'
|
86
|
+
connect @living_room, @bedroom, 'north'
|
87
|
+
@backpack = make Room, name: 'backpack', description: 'Your trusty backpack.', parent: @bedroom
|
88
|
+
@book = make Room, name: 'book', description: 'Your favorite novel.', parent: @living_room
|
89
|
+
end
|
90
|
+
|
91
|
+
script do
|
92
|
+
introduction do |actor|
|
93
|
+
actor.parent = @living_room
|
94
|
+
actor.tell "You're in your house."
|
95
|
+
end
|
96
|
+
end
|
84
97
|
end
|
85
98
|
end
|
86
99
|
```
|
@@ -104,7 +117,7 @@ Test the game in a browser by starting a server:
|
|
104
117
|
$ rake web:run
|
105
118
|
```
|
106
119
|
|
107
|
-
Open `http://localhost:
|
120
|
+
Open `http://localhost:9000` to run the game in debug mode.
|
108
121
|
|
109
122
|
Build a standalone web game:
|
110
123
|
|
@@ -113,10 +126,9 @@ $ rake web:build
|
|
113
126
|
```
|
114
127
|
|
115
128
|
The game's HTML file and related assets will be generated in the
|
116
|
-
`
|
117
|
-
|
118
|
-
|
119
|
-
to play the game.
|
129
|
+
`web/build` directory. The SDK uses opal](https://github.com/opal/opal)
|
130
|
+
to compile Ruby code to JavaScript, so the web build does not require a
|
131
|
+
Ruby interpreter. Open `index.html` in a browser to play the game.
|
120
132
|
|
121
133
|
Note: building the web app requires [Node.js](https://nodejs.org).
|
122
134
|
|
@@ -124,7 +136,7 @@ Note: building the web app requires [Node.js](https://nodejs.org).
|
|
124
136
|
|
125
137
|
The gamefic-sdk repo includes several example projects that provide more
|
126
138
|
complete demonstrations of Gamefic's features. To run an example, copy
|
127
|
-
its `
|
139
|
+
its `plot.rb` file to your own project.
|
128
140
|
|
129
141
|
### Learning More
|
130
142
|
|
data/lib/gamefic-sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gamefic-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gamefic
|