Skip to content

Instantly share code, notes, and snippets.

View ismyhc's full-sized avatar

Jacob Davis ismyhc

View GitHub Profile
@ismyhc
ismyhc / autoload
Created June 27, 2012 19:39
Issue when building gosu/chingu game with releasy
/Users/jdavis/Development/galaxoid/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/vendor/gems/chingu-0.8.1/lib/chingu/assets.rb:37:in `autoload': Can't load image "outerspace_pattern.jpg" (RuntimeError)
from /Users/jdavis/Development/galaxoid/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/vendor/gems/chingu-0.8.1/lib/chingu/named_resource.rb:109:in `[]'
from /Users/jdavis/Development/galaxoid/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/application/lib/start_menu.rb:11:in `initialize'
from /Users/jdavis/Development/galaxoid/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/vendor/gems/chingu-0.8.1/lib/chingu/game_state_manager.rb:300:in `new'
from /Users/jdavis/Development/galaxoid/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/vendor/gems/chingu-0.8.1/lib/chingu/game_state_manager.rb:300:in `game_state_instance'
from /Users/jdavis/Development/galaxoid/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/vendor/gems/chingu-0.8.1/lib/chingu/game_state_manager.rb:148:in `push_g
$ /Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/MacOS/Galaxoid ; exit;
/Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/lib/rexml/source.rb:169:in `initialize': uninitialized constant Encoding::UTF_8 (NameError)
from /Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/lib/rexml/source.rb:17:in `new'
from /Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/lib/rexml/source.rb:17:in `create_from'
from /Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/lib/rexml/parsers/baseparser.rb:139:in `stream='
from /Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.app/Contents/Resources/lib/rexml/parsers/baseparser.rb:116:in `initialize'
from /Users/ge.unx.sas.com/vol/vol420/u42/jacdav/Dropbox/pkg/galaxoid_0_1_OSX/Galaxoid.ap
/Galaxoid.app/Contents/Resources/lib/rexml/source.rb:169:in `initialize': uninitialized constant Encoding::UTF_8 (NameError)
GEM
remote: http://rubygems.org/
specs:
chingu (0.9rc8)
gosu (>= 0.7.43)
gosu (>= 0.7.43)
crack (0.3.1)
gosu (0.7.43)
mime-types (1.18)
ocra (1.3.0)
source 'http://rubygems.org'
gem 'chingu', "0.9rc8"
gem 'rest-client', "1.6.7"
gem 'crack', :require => ["crack/xml", "crack/json"]
group :development do
gem 'ocra', '1.3.0'
end
class Play < Chingu::GameState
traits :timer, :effect
class << self
attr_accessor :score
end
def setup
@ismyhc
ismyhc / multi-touch dpad
Created August 29, 2012 16:15
Multi-touch Dpad
void HandleMove (DPadButton dPadButton)
{
if(dPadButton._direction == "left")
{
GMain.instance.moveLeftPressed = true;
dPadButton.alpha = 0.2f;
}
if(dPadButton._direction == "right")
{
@ismyhc
ismyhc / multi-touch dpad update
Created August 29, 2012 21:29
Multi-touch Dpad update
void HandleFire (FireButton fireButton)
{
if(fireButton._isBeingTouched)
{
CreateBullet();
fireButton.alpha = 0.2f;
}
else if(!fireButton._isBeingTouched)
{
fireButton.alpha = 0.1f;
@ismyhc
ismyhc / collision issue
Created September 6, 2012 23:20
collision issue
// Laser/Enemy Collision detection
for(int i = _laser.Count-1; i >= 0; i--)
{
Laser laser = _laser[i];
Rect laserRect = laser.textureRect.CloneAndScaleThenOffset(laser.scaleX, laser.scaleY, laser.x, laser.y);
for(int ii = _enemy.Count-1; ii >= 0; ii--)
{
Enemy enemy = _enemy[ii];
Rect enemyRect = enemy.textureRect.CloneAndScaleThenOffset(enemy.scaleX, enemy.scaleY, enemy.x, enemy.y);
@ismyhc
ismyhc / collision issue update
Created September 7, 2012 01:01
collision issue udpate
// original code..
//
private void CreateEnemyEffect(Enemy enemy)
{
Vector2 enemyPos = _effectHolder.LocalToLocal(enemy,Vector2.zero);
if(_ready)
{
for (int i = 0; i < 10; i++)