orbitalimpact / opal-phaser

A fast and free Opal wrapper for the Phaser framework to develop browser-based games in Ruby!
http://opalphaser.com/
101 stars 9 forks source link

Fix Demo #7

Closed ndrluis closed 9 years ago

ndrluis commented 9 years ago

plz does not merge this PR until demo is working perfectly <3

Acceptance Criteria

ndrluis commented 9 years ago

Oh gosh, I learned the hard way... If you want to make your game more ruby like ONLY create game objects via GameObjectFactory

ylluminarious commented 9 years ago

@andreanastacio Hey, sorry I haven't said much or made commits this past week. I've been sick and busy with some other stuff. I just noticed yesterday this PR and how you're trying to make the demo work. Yeah, I've also had to learn the hard way that you have to use GameObjectFactory to make the the wrapper more Ruby-like.

ylluminarious commented 9 years ago

Btw, we should also have the star collectible items working for the demo. In case you don't know what I mean, here's the article we were basing the demo off of: http://www.photonstorm.com/phaser/tutorial-making-your-first-phaser-game

ylluminarious commented 9 years ago

@andreanastacio So, I noticed that the player is not getting properly added into the world for some reason, and I saw your commit where basically @game.add.sprite creates a new sprite in the World group. However, I tested it and it doesn't seem to be working yet for some strange reason. Do you have anything on your end as to why the player is not yet getting created in the world?

ndrluis commented 9 years ago

@ylluminarious "fixed" but still with error. Instead of initiate with initial position, the player are initiated with full sprite sheet.

ylluminarious commented 9 years ago

@andreanastacio Yeah, I see what you mean. It's showing the whole sprite sheet there. It looks like it's also giving an error that body.bounce is undefined. I'll try and look into it and see if I can fix it.

ylluminarious commented 9 years ago

@andreanastacio I fixed the body properties on the sprite, so they seem to be working now. Now only the animation is still having problems. Btw, before I noticed your commits to this demo branch, I was working on a similar Physics::Arcade::Body class here. I noticed that the one you made (which is the one here on GitHub) and the one I made are both having an error about sprite.texture.frame in Phaser's Body class. I thought it was interesting that this error has come twice, in both the class I was making and the one you've made. I was hoping that we could get the class working eventually, so that don't have to rely on alias_native, but we don't need to worry about it right now.

ndrluis commented 9 years ago

thx <3

ylluminarious commented 9 years ago

Np

ndrluis commented 9 years ago

FYI, I tried to use Forwardable to delegate Sprite methods to Player, but I caught some leaks.

ylluminarious commented 9 years ago

@andreanastacio The demo appears to be working perfectly now, so I think this PR is ready for merging :)

ndrluis commented 9 years ago

:shipit: