Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Can I use Gosu to make an Isometric 2D game?
- - By Eamonn Date 2013-05-15 19:44
Hello. I am planning to make a game with Ruby and Gosu. I was gonna use RubyGame but found no good tutorials on it. So I found this nifty little library with a good few tutorials. Bear in mind I'm still learning Ruby.

So I am planning on making my game with the Isometric camera view. For those that don't know it's like the camera view from the old pokemon DS games(Pokemon Perl + Diamond). Can Gosu create that camera angle? If so could you maybe link me to a video/tutorial on how to do it? This may be a little stupid, so if it is would it become clearer when I finish learning Gosu and Ruby? Thank you for any feedback and please don't hate on this if it is stupid :D
Parent - By ExplodingCookie Date 2013-05-15 23:11
These are the movement method I use in Stageoids

To activate the move command, put this function into the update function in main.rb file.

if button_down? Gosu::Button::KbLeft
     @player.move_left
end

This calls the move_left function in the player.rb file. This is...

def move_left
   //Move left at the speed the move_speed value
   @x = @x - @move_speed
   //Make it so we can't leave the screen
   if @x < 0
       @x = 0
   end
end

For this to work, you need to define these variables in the player.rb file's initialize function.
@x = 0
@y = 0
@move_speed = 10

This will start you in the bottom left corner.

For the other directions duplicate the functions and replace the values as follows...
::Right::
KbLeft -> KbRight
move_left -> move_right
@x - @move_speed -> @x + @move_speed
@x < 0 -> @x > 0

::Up::
KbLeft -> KbUp
move_left -> move_up
@x - @move_speed -> @y + @move_speed
@x < 0 -> @y > 0

::Down::
KbLeft -> KbDown
move_left -> move_down
@x - @move_speed -> @y - @move_speed
@x < 0 -> @y < 0

To create the player to move around in your game, use @player = Player.new(self) in the initialize function in main.rb

For collisions with walls, I suggest you have a look the Cptn. Ruby tutorial.

As for the scrolling, unfortunately, I have no idea.

When you have a working prototype, create a post in the showcase forum with the file attached so people can download it and help you work errors and bugs out.
Parent - - By jlnr (dev) Date 2013-05-16 12:41
This game should be pretty good to learn from: http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?pid=5117

Edit: Oh, Pokemon was not rendered at a 45° angle? Then it should be even easier :) I think these two games should be exactly right:

http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?pid=6396
http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?pid=4486
Parent - By ExplodingCookie Date 2013-05-16 15:05
Yes, Pokémon, Earthbound/Mother and early Legend of Zelda games used this viewpoint.
Parent - - By chase4926 Date 2013-06-03 18:03
Lol! I don't think you meant to link to Galen's Quest.

Maybe this is what you meant: http://www.libgosu.org/cgi-bin/mwf/topic_show.pl?tid=708
Parent - By jlnr (dev) Date 2013-06-03 19:40
Ah right! :)
Parent - - By RunnerPack Date 2013-05-16 23:15
I think what you're referring to is called an "oblique projection". See: http://en.wikipedia.org/wiki/File:Graphical_projection_comparison.png
Parent - - By Eamonn Date 2013-05-17 14:46
Hey that IS what I'm looking for. I was told somewhere it was called isometric. Is this achievable using Gosu?
Parent - By RunnerPack Date 2013-05-21 04:15
You can achieve * A N Y T H I N G * using Gosu! ;)

But seriously, yes you can. It's basically just a "top-down" perspective combined with the right graphical style (in fact, remember the dungeons in LoZ? The walls were top-down, but everything else was oblique!) The only semi-difficult thing is collision-detection, and then only if you want to be able to walk "behind" stuff (which LoZ games don't usually let you do).

If you want to do jumping or other "Z-axis" stuff, you just have to use the desired Z coordinate to modify the base Y coordinate. I've done this in Flash/AS3.
Parent - By Spooner Date 2013-05-17 08:59
I made an isometric game  which worked quite well in Gosu: http://spooner.github.io/games/smash_and_grab/
Up Topic Gosu / Gosu Exchange / Can I use Gosu to make an Isometric 2D game?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill