Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic Garden Hero By zhzhussupovkz Date 2014-08-03 15:07
Hello world! My new game developed by Gosu - Garden Hero. My first adventure game.

https://github.com/zhzhussupovkz/garden-hero

controls: movement - arrow keys. space - fire
Topic Super Bee - game about bee By zhzhussupovkz Date 2014-04-10 18:42
No, all is OK. But when I take screenshot by printscreen on my Debian I have system cursor in game window. When I play game all is OK
Thank you very much for Gosu library! In my next game I add more animations and physics
Topic Super Bee - game about bee By zhzhussupovkz Date 2014-04-09 17:26
I add screenshots to readme file in github:

https://github.com/zhzhussupovkz/super-bee

Gameplay is very simple, simple physics and AI.... I think enemy's haven't AI. In the future, I add AI to enemies.
You must kill enemies by weapon, by bomb and collect nectar from flowers. It's all. And sometime you have prizes with stamina, ammo, scores or lives.
Images and icons not mine, free license images.
It's my second game in my life.
Sorry for my English, please.
Topic Super Bee - game about bee By zhzhussupovkz Date 2014-04-03 09:44
Hello world! My second game developed by Gosu Ruby gem.
https://github.com/zhzhussupovkz/super-bee
Game is simple, AI of enemies are easy. Icons and graphics free license images
Topic simple taxi game By zhzhussupovkz Date 2014-01-04 20:47
Thanks for your comments. My game is very simple, and your can take more than 1 pass, game over when your lives is 0 or fuel is 0. I will work and swing skills in gamedev. As for the icons, I found them on findicons.com :)))
Topic simple taxi game By zhzhussupovkz Date 2014-01-04 13:10
Good evening! (19:08 in Astana, Kazakhstan). My name is Zhassulan and surname is Zhussupov. I'm from Kazakhstan (.kz), so my nickname is zhzhussupovkz. :) Thank you very much for creating Gosu framework for develop funny games! I'm novice in game development, thanks for the comment to my code in github. I would like to take part in team development fun games. Sorry for my English
Topic simple taxi game By zhzhussupovkz Date 2014-01-04 08:28
Simple 2d game where you will take the passengers to their destination. Have the opportunity to win prizes in the form of fuel, money and car repair. Transmission - manual. Development of the game continues

https://github.com/zhzhussupovkz/taxi
Topic Ground in game By zhzhussupovkz Date 2013-11-06 15:51
Thank you very much. It's really easy
Topic Ground in game By zhzhussupovkz Date 2013-11-06 15:50
Thanks. https://github.com/zhzhussupovkz/mouse
Topic Ground in game By zhzhussupovkz Date 2013-11-02 12:56
Hello world! I write a simple platformer where mouse eat cheeses from platforms. My code for mouse

1. Player class:

#class Player
class Player

  def initialize window, x, y, left, right
    @x, @y = x, y
    @left = Gosu::Image.new(window, left, false)
    @right = Gosu::Image.new(window, right, false)
    @face_left = true
  end

  attr_reader :x, :y

  #move left
  def move_left
    @face_left = true
    @x -= 5.0
    @x = 1.0 if @x <= 1.0
  end
 
  #move right
  def move_right
    @face_left = false
    @x += 5.0 if @x <= 595.0
  end
 
  #up
  def up
    @y -= 7.0 if @y >= 17.0
  end

  #move down
  def down
    @y += 2.5 if @y <= 372.5
  end
 
  #move
  def move
    @x %= 640
    @y %= 480
  end

  #draw
  def draw
    if @face_left
      @left.draw(@x, @y, 1)
    else
      @right.draw(@x, @y, 1)
    end
  end

end

2.Mouse class:

#class Mouse - main player
class Mouse < Player

  def initialize window, x, y
    super window, x, y, "images/mouse.png", "images/mouse-r.png"
    @score, @lives = 0, 3
    @heart = Gosu::Image.new(window, "images/heart.png", false)
    @ui = Gosu::Font.new(window, 'Monaco', 25)
    puts "Create mouse..."
    @on_ground = false
  end

  attr_reader :lives, :score
  attr_accessor :on_ground

  #draw mouse
  def draw
    super
    @ui.draw("Score: #{@score}", 10, 450, 2)
    @heart_x = 0
    @lives.times do
      @heart.draw(600-@heart_x, 450, 2)
      @heart_x += 24
    end
  end

  #move down
  def down
    @y += 2.5 if @y <= 372.5
  end

  #dead
  def dead
    @lives -= 1
    @lives = 0 if @lives <= 0
  end

  def dead?
    return @lives == 0
  end

  #add score
  def add_score
    @score += 100
  end

end

3.Level class:
#class Level
class Level

  def initialize window
    @window, @num = window, 0
    @cheeses = []
    @bricks = []
    @ui = Gosu::Font.new(@window, 'Monaco', 25)
    puts "Initialize levels..."
  end

  attr_reader :ui, :num
  attr_accessor :bricks, :cheeses

  #starting level
  def start
    @num += 1
    (2+@num).times do
      @x_cord = rand(10..550)
      @y_cord = rand(50..325)
      @cheeses << Cheese.new(@window, @x_cord, @y_cord)
      @bricks << Brick.new(@window, @x_cord - 10, @y_cord + 36)
    end
    puts "Starting level #{@num}."
    puts "Go!"
  end

  #draw
  def draw
    @cheeses.each do |e| e.draw end
    @bricks.each do |e| e.draw end
    @ui.draw("Level:#{@num}", 10, 425, 2)
  end

  #max scores in level
  def total_scores
    (2*@num + 0.5 * @num * (@num+1))*100
  end

  #end level
  def end_level
    @cheeses = []
    @bricks = []
  end

end

4.Main window:
#main window
class MyWindow < Gosu::Window

  def initialize
    puts "Start environment..."
    super 640, 480, false
    self.caption = 'Mouse Game'
    @bg = Gosu::Image.new(self, 'images/bg.png', true);
    @music = Gosu::Song.new(self, 'sounds/music.ogg')
    puts "Create game music..."
    @music.play(looping = true)
    @mouse = Mouse.new(self, 520, 375)
    @level = Level.new(self)
    @level.start
  end

  #game logic
  def update
    if @mouse.score == @level.total_scores
      @level.end_level
      @level.start
    end
    @mouse.move_left if button_down? Gosu::KbLeft
    @mouse.move_right if button_down? Gosu::KbRight
    @mouse.up if button_down? Gosu::KbUp or button_down? Gosu::KbSpace
    @mouse.down if @mouse.on_ground == false
    @mouse.move
    @level.cheeses.each do |e|
      if (e.x - @mouse.x).abs <= 15.0 && (e.y - @mouse.y).abs <= 15.0
        e.drawing = false
        e.x = e.y = -1
        @mouse.add_score
      end
    end
  end

  def draw
    @level.draw
    @mouse.draw
    @bg.draw(0, 0, 0)
  end

  def button_down(key)
    case key
    when Gosu::KbEscape
      @music.stop
      close
      puts "Exit."
    end
  end

end

How can I create logic:
Stop falling down mouse if he standing in platform and fall down if he jump from platform?
I try when mouse intersects by x and y with platform but he fall down always

Thanks for all, and sorry for my English! (I'm novice in game development)
Topic How to clear image in main window? By zhzhussupovkz Date 2013-10-16 06:54
Thanks for your answer!
Topic How to clear image in main window? By zhzhussupovkz Date 2013-10-16 06:54
Thank you very match. I'm novice in game development
Topic How to clear image in main window? By zhzhussupovkz Date 2013-10-14 18:18
Hello world! I need help! I read Gosu documentation, but not found method for delete images from window:
For example:

#class Cheese
class Cheese

  def initialize window, x, y
    @image = Gosu::Image.new(window, "images/cheese.png", false)
    @x, @y = x, y
  end

  #draw cheese
  def draw
    @image.draw(@x, @y, 1)
  end

  def delete
    #what I write here for delete image? In Gosu::Image documentation i not found answer for my question
  end

end

Thanks for all, and sorry for my English!

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill