Fixed overworld weather fading out/in when walking between maps with the same weather, added support for Sprite coordinates being floats

This commit is contained in:
Maruno17
2023-07-30 20:32:39 +01:00
parent 4f14108772
commit 4c25ade184
5 changed files with 113 additions and 80 deletions

View File

@@ -338,3 +338,34 @@ module RPG
end
end
end
#===============================================================================
# A modification to class Sprite that allows its coordinates to be floats rather
# than integers.
#===============================================================================
class Sprite
attr_accessor :float
alias :__float__x :x
alias :__float__y :y
alias :__float__x_equals :x=
alias :__float__y_equals :y=
def x
return (@float) ? @real_x : __float__x
end
def y
return (@float) ? @real_y : __float__y
end
def x=(value)
@real_x = value if @float
__float__x_equals(value)
end
def y=(value)
@real_y = value if @float
__float__y_equals(value)
end
end