我想把图片中的那个蓝色三角形放在我的红房子上。我一直在输入随机数,但我无法正确输入。问题出在 Gosu.draw_triangle 部分。人们说这个网站会帮助 https://www.rubydoc.info/github/gosu/gosu/master/Gosu.draw_triangle 但我没有从中得到任何好处。
def initialize
def initialize
super(800, 600, false)
end
def draw
Gosu.draw_rect(310, 300, 200, 150, Gosu::Color::RED, ZOrder::TOP, mode=:default)
Gosu.draw_rect(385, 380, 50, 70, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)
Gosu.draw_rect(460, 335, 35, 35, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)
Gosu.draw_rect(0, 450, 1000, 400, Gosu::Color::GREEN, ZOrder::TOP, mode=:default)
Gosu.draw_rect(200, 100, 100, 45, Gosu::Color::WHITE, ZOrder::TOP, mode=:default)
Gosu.draw_rect(100 , 350, 45, 120, 0xff_AC5B13 , ZOrder::TOP, mode=:default)
Gosu.draw_triangle(20, 30, Gosu::Color::BLUE, 440, 230, Gosu::Color::BLUE, 50, 345, Gosu::Color::BLUE, ZOrder::TOP, mode=:default)