Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Showcase / A tiny world
- By ippa Date 2009-07-08 19:52
I was competing in rubyweekend #3 (72 hour game compo) this other week, and I "finished" a game in gosu/chipmunk/texplay .. you might wanna check it out, the readme follows:

------------------------------------------------------------
A Tiny World (28 Juni 2009)
============================
By: ippa (AT) rubylicio (dot) us / ippa @ #freenode
Entry for RubyWeekend #3 [http://rubygame.org/forums/viewtopic.php?f=8&t=38]

Packaged bundles
================
Windows: http://ippa.se/a_tiny_world.exe
OSX: http://ippa.se/a_tiny_world_intel_mac.zip
Linux: http://github.com/ippa/a_tiny_world/tree/master   ... :P

Game
====
Crush the minis and their world!
Bonus for kicking minis to death while in the air. Don't get bitten in the legs!
Move legs with Arrows. Kick with Space.

Thoughts
========
72 hours was abit long, I wasted 1-2 days in the sun and still started to get bored :p.
48 hours is probably enough.

Chipmunk-tweaking, especially syncing gfx to chipmunk-shapes, was hell and took alot of time.
I need to make a lib that solves this better and automaticly. Preferable via SVG-files.

Win32 Deployment with Ocra [http://github.com/larsch/ocra/tree/master] is cool.

I can't seem to find the perfect way of organizing levels... rubycode? singletonclass? yaml-files?

Actually taking time to work on alot of (easy) details, like simple bloodsplatter and various soundFX, really adds to
the final experience.

Requires
========
Gosu: http://www.libgosu.org/
- "gem install gosu"

Chipmunk: http://wiki.slembcke.net/main/published/Chipmunk
- You'll need edge from http://code.google.com/p/chipmunk-physics/

Texplay: http://banisterfiend.wordpress.com/2008/08/23/texplay-an-image-manipulation-tool-for-ruby-and-gosu/
- 0.1.4.5 works
------------------------------------------------------------

I'm probably gonna continue working on this when I get the time.. since it felt like it could become a really fun game.
- By banister Date 2009-07-09 04:57 Edited 2009-07-09 06:49
hey

i really like your game and i think it has alot of potential but just a few things: 

(1) the TexPlay color param actually takes floats (in the range of 0.0 to 1.0) not ints, so you should probably change your code to: color [0.5, 0.5, 0.5] rather than color [100, 100, etc]

(2) i see you tried to splice in a bite image but then commented out that line. were you having trouble getting splice to do what you want? i use TexPlay's splice to do something similar in tremolo and i do it by creating an image 'mask' (i.e the shape i want is full alpha on a white background) and then splicing it in using the :mask => :alpha  hash arg to splice.

(3) also do you think youll make the back leg move realistically in a later version? (im sure its a pain in the ass to do that but it would be worth the effort for presentation purposes).

another thing; do you plan to make the levels bigger and add horizontal scrolling ? i dont know how far you want to take the game idea but i think it could work as a fully developed game if you wanted it to.

:)

banister
- By ippa Date 2009-07-09 12:09
1) allright!

2) It spliced what I wanted.. I just played between the having a mini attach (splice) himself to the leg Or just leave a blody hole.. the miniattaching became more prune to looking bad in certain situations, mainly I think when chipmunks collisiondetection couldn't keep up with some fastpace movement.

.. Then Julian asked "why does minis leave a hole in the leg with red pixels hanging in the air?" .. HAH :)

so.. now the next idea is to paint a bigger red circle (the outlining blood), and then a smaller circle-hole inside it..

3) I pondered alot about the backleg
- having a key to switch leg you're controlling with the arrowkeys
- having a key to just jump the backleg forward a set length
- having it's own set of arrowkeys (A,D,S,W) for full controll of both legs at the same time.

.. It ended up the way it did cause I think simplicity (especially in a small game like this) is good.. shouldn't be advanced controlls to learn or master.. so the backleg just skips along when you move the front-leg forward and it hits a certain width between the 2 legs (and you still hold the left-arrow down). If anyone got a good idea, let's hear it :P

I actually started with horizontal scrolling in mind but was scrapped due to complexity / timelimit. It's most likely a cool idea.. with the legs reaching various places, buildings on his own, triggering mini-rushes and other stuff comming at him. I also have http://pastie.org/539916 ready-made :) very advanced ;)... I should add automatic z-order there.

Btw, thanks for the reply on your blog ... what should I compile with? mingw? microsoft visual studio express? extconf.rb currently fails me cause it can't find winsock2.h, which I have, I'm just not sure how to tell extconf.rb where it is :)

Another question.. if you look at the gosu-sample "RMagickIntegration.rb".. the dynamic ground is fabolous, is texturefilling a (big) vector something that's alot of work to add in texplay? The example also make it even prettier by darkening the ground downwards... Alot of sidescrollers could use this.. I usually go for vectorgrounds/chipmunk and not plain horizontal tiles.
- By Shinobi Chef Date 2009-07-09 14:51
Kool game :)

Thanks for sharing!

would like to see you make it into a full game,as once I finished it I wanted more levels :)
- By banister Date 2009-07-09 22:27
i just compile using visual c++ 6.0 when im building on windows, using the same setup matz recommends for compiling ruby. not sure about using other windows compilers, i usually stay away from windows these days :) you can tell the compiler where to locate header files using the -I option though....

ill have to look at that imagemagick feature before i can comment, currently im away on holiday in new caledonia  :)

im actually concentrating on expanding the macro ability in TexPlay to let people extend the library themselves, if i can get macros to be fast enough i may even move the circle, line, box functions to rubyspace in the form of macros too. adding a darkening effect to TexPlay as a macro should be trivial though, even in TexPlay's current form you can make a darkening macro (though it'd maybe be a bit slow since you have to use get_pixel, the next version will provide an each_pixel iterator to the image class to speed things up a bit hopefully, im also going to play around with simd just for fun and to see if it gives a speed boost in some situations)

a simple macro to darken a pixel might look like this:

TexPlay.create_macro(:darken) { |x, y|
    clr = get_pixel(x, y)

    clr[0] /= 2    # red
    clr[1] /= 2    # green
    clr[2] /= 2    # blue

    color clr
    pixel(x, y)
}

and use like this: image.darken(10, 10)      to darken the pixel at (10, 10)

if using in a current version of TP you might need to put the pixel call in a paint block, newer versions dont require this.
- By banister Date 2009-07-14 23:12
hey just letting you know that flood-filling and bezier curves are coming to texplay, im just deciding on which algorithms to use
- By banister Date 2009-08-21 00:42
just saw you got 2nd place in the RubyWeekend competition for this game, congrats!
http://rubygame.org/forums/viewtopic.php?f=8&t=46
- By lobo_tuerto Date 2009-08-21 01:03 Edited 2009-08-21 05:56
I think it would be a good idea to bundle the chipmunk.so with the Linux files... I haven't been able to compile it and can't try this game :(

Update
======================================
Well, finally I could get the ruby extension working...
And nice minigame! I was finally able to try it. :)
Up Topic Gosu / Gosu Showcase / A tiny world

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill