
xml-simple gem :)
close if button_down? KbEscapeif @obrot == :prawo thenthen; It just isn't necessary. Also, that bit is crying out to be a case statement.for i in 0..2 do => (0..2).each do |i| (Although for might feel better if you are coming from another language, it is extremely limiting once you try to do a bit more with Ruby)def block?(x,y); @map_main[(y/32)][(x/32)] != 0; endprint(Time.now.strftime("%H:%M:%S.%L") + " - " + message.to_s + "\n") => puts "#{Time.now.strftime("%H:%M:%S.%L")} - #{message}" (although I suggested using a logger for this).
attr_accessor :speed, :gravity, :x, :y
def pos; [@x, @y]; end
def pos=(value); @x, @y = value; end
@gracz.pos = [5, 100] or @gracz.x = 5 or puts @gracz.gravity to manipulate the instance variables in a more friendly manner.pos, as it is tempting to write @gracz.pos.x = 5 which will not work (it only replaces the first element in a temporary array).then :)
@gracz.x, @gracz.y = [3, 5] if you want to set the value with an Array.
@gracz.x, @gracz.y = 3, 5
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill