问题标签 [rubygame]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
335 浏览

ruby - Rubygame + OSX hello world 在启动时崩溃

我遇到了 ruby​​game 和 OSX 的启动时崩溃问题。

有谁知道可能是什么原因造成的,以及如何解决?

版本:OSX 10.5.7,ruby 1.8.7(2009-06-12 补丁级别 174)[i686-darwin9],从 ruby​​gem 安装的 ruby​​game 2.5.3,大多数软件安装 MacPorts(最新)。

不同版本的 ruby​​ 和 ruby​​game 似乎有相同的问题。谷歌搜索没有帮助。Pygame 在同一台机器上工作,所以 SDL 应该没问题。有任何想法吗?这是堆栈跟踪。

$ ruby​​ -e '需要“红宝石”;需要“rubygame”;Rubygame.init' 2009-07-30 18:13:20.416 ruby​​[66473:10b] * _NSAutoreleaseNoPool(): Object 0x116ebb0 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c309 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.418 ruby​​[66473:10b]_NSAutoreleaseNoPool(): Object 0x116f030 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c341 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.418 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x116f6e0 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c37b 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.419 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x116f340 of class NSCFDictionary autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c3de 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.420 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceb84 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.421 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x116fa90 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x95967b6a 0x9493c48d 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07- 30 18:13:20.422 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceb94 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.423 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x116f6f0 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x95967b6a 0x9493c48d 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07- 30 18:13:20.423 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceba4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.424 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x116aac0 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x95967b6a 0x9493c48d 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07- 30 18:13:20.425 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05cebb4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.426 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x116aac0 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x95967b6a 0x9493c48d 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07- 30 18:13:20.427 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceba4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.428 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05cebb4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.428 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceba4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.429 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05cebb4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.430 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceba4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.430 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceba4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.431 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa05ceba4 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c444 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.432 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x115bce0 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9493c55d 0x95e818b8 0x95e80239 0x95e906d6 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.434 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x11703f0 of class __NSFontTypefaceInfo autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9495240e 0x94952280 0x94951b27 0x94999773 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.435 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x1171450 of class NSAffineTransform autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x94952916 0x95e818b8 0x95e80239 0x95e906d6 0x94951d3a 0x94999773 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07 -30 18:13:20.436 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x1171900 of class NSFont autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x94952842 0x94951d3a 0x94999773 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18 :13:20.436 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x1171a40 of class NSFont autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x94951e07 0x94999773 0x94998753 0x94996959 0x9499669e 0x9499604d 0x94995b8c 0x94993b88 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18: 13:20.438 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x11726b0 of class NSCFArray autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9499f9fa 0x9499f91b 0x9499f85b 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.439红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x11735f0 of class NSCFSet autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x90135eb0 0x9499fb66 0x9499f91b 0x9499f85b 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13: 20.440 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x11737d0 of class NSCFArray autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9013601f 0x9499fb66 0x9499f91b 0x9499f85b 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13: 20.441 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x11738b0 of class NSCFArray autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x90135118 0x9499f961 0x9499f85b 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.441红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x1171a40 of class NSFont autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x94951a41 0x9499f882 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.443 ruby [66473:10b]_NSAutoreleaseNoPool(): Object 0xa001ce20 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x95983c08 0x94965d1c 0x949a0b2d 0x949a056e 0x949a03e6 0x949a0317 0x949a01b7 0x9499f8a7 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.444 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0xa00159a0 of class NSCFString autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x95983c08 0x94965d1c 0x949a0c36 0x949a0590 0x949a03e6 0x949a0317 0x949a01b7 0x9499f8a7 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13:20.444 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x114c300 of class NSCFNumber autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x949a0670 0x949a03e6 0x949a0317 0x949a01b7 0x9499f8a7 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13 :20.445 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x1175390 of class NSCalibratedWhiteColor autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x94aafba3 0x94aafaa3 0x94aaf17b 0x94aaed97 0x949a0294 0x9499f8a7 0x9499f648 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18: 13:20.446 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x1175630 of class NSCFArray autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9499f9fa 0x94ab2773 0x94ab255b 0x94ab0f6a 0x94ab0d1d 0x9499f661 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18:13 :20.447 红宝石[66473:10b]_NSAutoreleaseNoPool(): Object 0x11756f0 of class NSCFSet autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x90135eb0 0x9499fb66 0x94ab2773 0x94ab255b 0x94ab0f6a 0x94ab0d1d 0x9499f661 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18: 13:20.447 红宝石[66473:10b] *_NSAutoreleaseNoPool(): Object 0x1175650 of class NSCFArray autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9013601f 0x9499fb66 0x94ab2773 0x94ab255b 0x94ab0f6a 0x94ab0d1d 0x9499f661 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a) 2009-07-30 18: 13:20.448 ruby​​[66473:10b] *** _NSAutoreleaseNoPool(): Object 0x1175b20 of class NSCFDictionary autoreleased with no pool in place - just leaking Stack: (0x95a58f0f 0x95965442 0x9013c27e 0x94ab5606 0x94ab53fd 0x94ab0d92 0x9499f661 0x94993bee 0x6546a6 0x64a65b 0x61e670 0x61e6a7 0xa2e89 0x10b972 0x10c57c 0x109eb7 0x119d27 0x119d66 0x119d9a)

0 投票
4 回答
2585 浏览

ruby - 为什么rubygame和gosu比纯opengl慢?

我正在寻找一个好的图形框架来用 Ruby 制作一个漂亮的 2D 游戏。我做了 3 个非常简单的测试,看看在GosuRubygame之间哪个图形 Ruby 框架更快。该测试创建了 1000 个“Square”类的实例,这些实例使用框架的方法以最简单的方式移动并绘制了一个红色方块。第三个测试是同样的事情,但在一个纯 OpenGL 实现中(没有任何框架)。这是结果:

纯 OPENGL(使用 ruby​​-opengl)80Fps: 替代文本 http://grab.by/JTM

GOSU(使用 ruby​​-opengl + gosu)46Fps: 替代文本 http://grab.by/JTC

RUBYGAME (使用 ruby​​-opengl + ruby​​game + rsdl) 32Fps : alt text http://grab.by/JTw

为什么纯 OpenGL 测试与 Rubygame 或 Gosu 测试之间的 fps 差异如此之大?(他们都使用opengl吗)

这些框架真的可靠还是我应该使用更好的框架?(我不认为自己经历了在纯 OpenGL 中加载图像声音和字体的整个过程:p)

你怎么看?

0 投票
2 回答
482 浏览

ruby - OS X shebang问题上的Rubygame

我在玩 Rubygame。我用 Mac Pack 安装了它,现在我有了 rsdl 可执行文件。rsdl game.rb工作正常,但是当我 chmod +x rb 文件时,将 shebang 添加到 rsdl(尝试直接路径和 /usr/bin/env rsdl)并尝试执行它(./game.rb),它开始在终端和 rsdl 之间闪烁试图打开,最终放弃并给出了一个bus error。有谁知道是什么原因造成的?如果它有所作为,我会使用 Snow Leopard (10.6.2)。

谢谢。

0 投票
3 回答
145 浏览

ruby - 简单的“或”没有按预期工作

我在下面相对简单的分配中遇到了一个有趣的问题。开头的每个带括号的块都评估为nil,留下应该分配Rubygame::Surface.new的值。@image不幸的是,在我设置的下一行@rect,它抛出NoMethodError因为@imagenil

类似的测试通过 IRB 运行,按预期工作,所以我很确定 'or' 语句格式正确,但我无法弄清楚为什么它没有返回新的 Surface 而其他一切都是nil

0 投票
0 回答
402 浏览

ruby-on-rails - Rubygame on rails:在 Rails 上使用 Rubygame gem 时支持音频格式(mp3、ogg)

安装 ruby​​game 后,我尝试在 ruby​​ 解释器上支持 midi、mp3、ogg、aiff 和 wav 文件,它工作正常。我同样使用了 Rubygame::Music 类和其中的方法。

但是当我在 Rails 框架上使用并尝试它时,只有 midi 格式正在工作,其余格式(mp3、ogg、aiff 和 wav)正在执行但没有声音。

经过一番谷歌搜索后,我看到了这个:http : //blog.rubygame.org/2008/04/01/rubygame-on-rails/ 根据它,“目前,RGoR(Rubygame over rails)中唯一的音频支持是播放 MIDI 1990 年流行歌曲的版本。但是,我希望在以后的版本中解决这些问题和其他问题。”

现在是否已在最新版本上修复此问题,是否有人在 RGoR 上尝试过这些格式(mp3、ogg)?

0 投票
1 回答
235 浏览

ruby - Rubygame::TTF - 字符串的宽度与其所有字符的宽度之间的差异

我正在尝试使用 Rubygame 将字符串的每个字符宽度确定为字符串总宽度的百分比......

上述字符串的程序输出是......

...并且根据字符串的长度和内容而有所不同。

结果很接近,但是...有谁知道为什么字符宽度之和与字符串宽度之和相差8?

任何帮助将不胜感激...

干杯...

戴维德

PS我也愿意接受有关其他/更好的方法的建议。

0 投票
1 回答
169 浏览

ruby-on-rails - 在 RoR 和 Jquery 中设置简单游戏字段的最佳方式是什么?

我想用 Ruby 编写简单的在线游戏。仅从单人模式开始。我做了一些关于用 ruby​​ 编写游戏的研究,我发现了这两个链接:

但我认为这可能是一种矫枉过正。

游戏假设

0 投票
17 回答
194300 浏览

ruby - “在任何存储库中都找不到有效的 gem”(rubygame 和其他)

我一直在尝试安装这个“rubygame”gem,但每当我使用命令时

它会给出一个错误:

我也尝试过其他宝石,但结果相似:

我已经确定我有互联网连接,并且已经尝试重新安装 ruby​​ 和 ruby​​gems(目前使用 ruby​​ 1.8,rubygems 1.7.2)。谷歌搜索根本没有帮助我。如果有人能解决我的问题,我将不胜感激。我的来源列表只显示http://rubygems.org

0 投票
1 回答
65 浏览

ruby - Rubygame:尝试启用传递参数来定义游戏屏幕大小

rubygame 教程有一个基本的屏幕创建部分,后面跟着一个 excersize 来修改代码以允许传递定义屏幕大小的命令行参数。我能够使用谷歌拼凑一些我认为可行的东西:

如果没有评论,我会收到一大堆我不理解的错误,并且在 Google 上发现的任何结果都很少。

随着评论我得到不同的错误:如果我给它一个无意义的参数,它会输出“字符串不匹配”如果我给它一个格式正确的请求,我会得到“无法修改冻结的字符串”

我不确定这是否是从参数中提取 x 和 y 值的最佳方法。

0 投票
1 回答
331 浏览

ruby - 如何检测圆和块之间的碰撞?

可能重复:
Circle-Rectangle 碰撞检测(intersection)
如何确定圆与矩形的碰撞?

我想检测一个圆与一个一般定位的块的交集或碰撞。该块是矩形的,可以是任何大小或旋转。

这背后的数学原理是什么?