libtcod 0.0.6 → 0.0.7
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 +0 -0
- data/Gemfile +0 -0
- data/LICENSE +0 -0
- data/README.md +81 -81
- data/Rakefile +0 -0
- data/bin/oryx_tiles.png +0 -0
- data/clib/amd64/libSDL.so +0 -0
- data/clib/i686/libSDL.dylib +0 -0
- data/clib/i686/libSDL.so +0 -0
- data/clib/i686/libtcod.dylib +0 -0
- data/examples/python_tutorial_part_1/arial10x10.png +0 -0
- data/examples/python_tutorial_part_1/terminal.png +0 -0
- data/examples/tile_demo/oryx_tiles.png +0 -0
- data/lib/libtcod.rb +0 -0
- data/lib/libtcod/bindings.rb +0 -0
- data/lib/libtcod/color_consts.rb +0 -0
- data/lib/libtcod/console.rb +0 -0
- data/lib/libtcod/consts.rb +0 -0
- data/lib/libtcod/map.rb +0 -0
- data/lib/libtcod/struct.rb +0 -0
- data/lib/libtcod/system.rb +0 -0
- data/lib/libtcod/version.rb +3 -3
- data/libtcod.gemspec +0 -0
- data/terminal.png +0 -0
- metadata +4 -4
data/.gitignore
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE
CHANGED
File without changes
|
data/README.md
CHANGED
@@ -1,81 +1,81 @@
|
|
1
|
-
# libtcod-ruby 0.0.
|
2
|
-
|
3
|
-
Ruby bindings for [libtcod 1.5.1](http://doryen.eptalys.net/libtcod/)
|
4
|
-
|
5
|
-
Currently tested on Linux and Windows using Ruby 1.9.3
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
gem install libtcod
|
10
|
-
|
11
|
-
## Examples
|
12
|
-
|
13
|
-
Here's a straight port of the [example code](http://roguebasin.roguelikedevelopment.org/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1_code#Moving_around) from part 1 of the python tutorial:
|
14
|
-
|
15
|
-
```ruby
|
16
|
-
require 'libtcod'
|
17
|
-
|
18
|
-
#actual size of the window
|
19
|
-
SCREEN_WIDTH = 80
|
20
|
-
SCREEN_HEIGHT = 50
|
21
|
-
|
22
|
-
LIMIT_FPS = 20 #20 frames-per-second maximum
|
23
|
-
|
24
|
-
def handle_keys
|
25
|
-
#key = TCOD.console_check_for_keypress() #real-time
|
26
|
-
key = TCOD.console_wait_for_keypress(true) #turn-based
|
27
|
-
|
28
|
-
if key.vk == TCOD::KEY_ENTER && key.lalt
|
29
|
-
#Alt+Enter: toggle fullscreen
|
30
|
-
TCOD.console_set_fullscreen(!TCOD.console_is_fullscreen())
|
31
|
-
elsif key.vk == TCOD::KEY_ESCAPE
|
32
|
-
return true #exit game
|
33
|
-
end
|
34
|
-
|
35
|
-
#movement keys
|
36
|
-
if TCOD.console_is_key_pressed(TCOD::KEY_UP)
|
37
|
-
$playery -= 1
|
38
|
-
elsif TCOD.console_is_key_pressed(TCOD::KEY_DOWN)
|
39
|
-
$playery += 1
|
40
|
-
elsif TCOD.console_is_key_pressed(TCOD::KEY_LEFT)
|
41
|
-
$playerx -= 1
|
42
|
-
elsif TCOD.console_is_key_pressed(TCOD::KEY_RIGHT)
|
43
|
-
$playerx += 1
|
44
|
-
end
|
45
|
-
|
46
|
-
false
|
47
|
-
end
|
48
|
-
|
49
|
-
#############################################
|
50
|
-
# Initialization & Main Loop
|
51
|
-
#############################################
|
52
|
-
|
53
|
-
TCOD.console_set_custom_font('arial10x10.png', TCOD::FONT_TYPE_GREYSCALE | TCOD::FONT_LAYOUT_TCOD, 0, 0)
|
54
|
-
TCOD.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'ruby/TCOD tutorial', false, TCOD::RENDERER_SDL)
|
55
|
-
TCOD.sys_set_fps(LIMIT_FPS)
|
56
|
-
|
57
|
-
$playerx = SCREEN_WIDTH/2
|
58
|
-
$playery = SCREEN_HEIGHT/2
|
59
|
-
|
60
|
-
until TCOD.console_is_window_closed
|
61
|
-
TCOD.console_set_default_foreground(nil, TCOD::Color::WHITE)
|
62
|
-
TCOD.console_put_char(nil, $playerx, $playery, '@'.ord, TCOD::BKGND_NONE)
|
63
|
-
|
64
|
-
TCOD.console_flush()
|
65
|
-
|
66
|
-
TCOD.console_put_char(nil, $playerx, $playery, ' '.ord, TCOD::BKGND_NONE)
|
67
|
-
|
68
|
-
#handle keys and exit game if needed
|
69
|
-
will_exit = handle_keys
|
70
|
-
break if will_exit
|
71
|
-
end
|
72
|
-
```
|
73
|
-
|
74
|
-
|
75
|
-
## Contributing
|
76
|
-
|
77
|
-
1. Fork it
|
78
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
79
|
-
3. Commit your changes (`git commit -am 'Added some feature'`)
|
80
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
81
|
-
5. Create new Pull Request
|
1
|
+
# libtcod-ruby 0.0.7
|
2
|
+
|
3
|
+
Ruby bindings for [libtcod 1.5.1](http://doryen.eptalys.net/libtcod/)
|
4
|
+
|
5
|
+
Currently tested on Linux and Windows using Ruby 1.9.3, and 32-bit OS X thanks to [@mistydemeo](https://github.com/mistydemeo). Other platforms may work if you have libtcod in a place where ffi\_lib knows to get it. All the original C functions are wrapped, following the [original documentation](http://doryen.eptalys.net/data/libtcod/doc/1.5.1/html2/line.html?c=true&cpp=false&cs=false&py=false&lua=false) closely. See the example for slight differences in invocation.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
gem install libtcod
|
10
|
+
|
11
|
+
## Examples
|
12
|
+
|
13
|
+
Here's a straight port of the [example code](http://roguebasin.roguelikedevelopment.org/index.php?title=Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_1_code#Moving_around) from part 1 of the python tutorial:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'libtcod'
|
17
|
+
|
18
|
+
#actual size of the window
|
19
|
+
SCREEN_WIDTH = 80
|
20
|
+
SCREEN_HEIGHT = 50
|
21
|
+
|
22
|
+
LIMIT_FPS = 20 #20 frames-per-second maximum
|
23
|
+
|
24
|
+
def handle_keys
|
25
|
+
#key = TCOD.console_check_for_keypress() #real-time
|
26
|
+
key = TCOD.console_wait_for_keypress(true) #turn-based
|
27
|
+
|
28
|
+
if key.vk == TCOD::KEY_ENTER && key.lalt
|
29
|
+
#Alt+Enter: toggle fullscreen
|
30
|
+
TCOD.console_set_fullscreen(!TCOD.console_is_fullscreen())
|
31
|
+
elsif key.vk == TCOD::KEY_ESCAPE
|
32
|
+
return true #exit game
|
33
|
+
end
|
34
|
+
|
35
|
+
#movement keys
|
36
|
+
if TCOD.console_is_key_pressed(TCOD::KEY_UP)
|
37
|
+
$playery -= 1
|
38
|
+
elsif TCOD.console_is_key_pressed(TCOD::KEY_DOWN)
|
39
|
+
$playery += 1
|
40
|
+
elsif TCOD.console_is_key_pressed(TCOD::KEY_LEFT)
|
41
|
+
$playerx -= 1
|
42
|
+
elsif TCOD.console_is_key_pressed(TCOD::KEY_RIGHT)
|
43
|
+
$playerx += 1
|
44
|
+
end
|
45
|
+
|
46
|
+
false
|
47
|
+
end
|
48
|
+
|
49
|
+
#############################################
|
50
|
+
# Initialization & Main Loop
|
51
|
+
#############################################
|
52
|
+
|
53
|
+
TCOD.console_set_custom_font('arial10x10.png', TCOD::FONT_TYPE_GREYSCALE | TCOD::FONT_LAYOUT_TCOD, 0, 0)
|
54
|
+
TCOD.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'ruby/TCOD tutorial', false, TCOD::RENDERER_SDL)
|
55
|
+
TCOD.sys_set_fps(LIMIT_FPS)
|
56
|
+
|
57
|
+
$playerx = SCREEN_WIDTH/2
|
58
|
+
$playery = SCREEN_HEIGHT/2
|
59
|
+
|
60
|
+
until TCOD.console_is_window_closed
|
61
|
+
TCOD.console_set_default_foreground(nil, TCOD::Color::WHITE)
|
62
|
+
TCOD.console_put_char(nil, $playerx, $playery, '@'.ord, TCOD::BKGND_NONE)
|
63
|
+
|
64
|
+
TCOD.console_flush()
|
65
|
+
|
66
|
+
TCOD.console_put_char(nil, $playerx, $playery, ' '.ord, TCOD::BKGND_NONE)
|
67
|
+
|
68
|
+
#handle keys and exit game if needed
|
69
|
+
will_exit = handle_keys
|
70
|
+
break if will_exit
|
71
|
+
end
|
72
|
+
```
|
73
|
+
|
74
|
+
|
75
|
+
## Contributing
|
76
|
+
|
77
|
+
1. Fork it
|
78
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
79
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
80
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
81
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
File without changes
|
data/bin/oryx_tiles.png
CHANGED
File without changes
|
data/clib/amd64/libSDL.so
CHANGED
File without changes
|
Binary file
|
data/clib/i686/libSDL.so
CHANGED
File without changes
|
data/clib/i686/libtcod.dylib
CHANGED
Binary file
|
File without changes
|
File without changes
|
File without changes
|
data/lib/libtcod.rb
CHANGED
File without changes
|
data/lib/libtcod/bindings.rb
CHANGED
File without changes
|
data/lib/libtcod/color_consts.rb
CHANGED
File without changes
|
data/lib/libtcod/console.rb
CHANGED
File without changes
|
data/lib/libtcod/consts.rb
CHANGED
File without changes
|
data/lib/libtcod/map.rb
CHANGED
File without changes
|
data/lib/libtcod/struct.rb
CHANGED
File without changes
|
data/lib/libtcod/system.rb
CHANGED
File without changes
|
data/lib/libtcod/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
module TCOD
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
1
|
+
module TCOD
|
2
|
+
VERSION = "0.0.7"
|
3
|
+
end
|
data/libtcod.gemspec
CHANGED
File without changes
|
data/terminal.png
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libtcod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- clib/amd64/libtcod.dylib
|
64
64
|
- clib/amd64/libtcod.so
|
65
65
|
- clib/i686/SDL.dll
|
66
|
+
- clib/i686/libSDL.dylib
|
66
67
|
- clib/i686/libSDL.so
|
67
68
|
- clib/i686/libtcod-mingw.dll
|
68
69
|
- clib/i686/libtcod.dylib
|
@@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
107
|
version: '0'
|
107
108
|
requirements: []
|
108
109
|
rubyforge_project:
|
109
|
-
rubygems_version: 1.8.
|
110
|
+
rubygems_version: 1.8.25
|
110
111
|
signing_key:
|
111
112
|
specification_version: 3
|
112
113
|
summary: Ruby bindings for the libtcod roguelike library
|
@@ -114,4 +115,3 @@ test_files:
|
|
114
115
|
- test/color.rb
|
115
116
|
- test/console.rb
|
116
117
|
- test/helpers.rb
|
117
|
-
has_rdoc:
|