Created
April 6, 2015 18:08
-
-
Save HimeWorks/8618372e856646c0580c to your computer and use it in GitHub Desktop.
Eight-Dir Movement patch for Modern Algebra's Extra Movement Frames
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sprite_Character | |
def ma_update_emf_src_rect | |
if @tile_id == 0 | |
if @character.direction % 2 == 0 | |
index = @character.character_index | |
pattern = @character.pattern < @emf_char_frames[0] ? @character.pattern : @emf_char_frames[1] | |
sx = (index % 4 * @emf_char_frames[0] + pattern) * @cw | |
sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch | |
self.src_rect.set(sx, sy, @cw, @ch) | |
else | |
index = @character.character_index + 1 | |
pattern = @character.pattern < @emf_char_frames[0] ? @character.pattern : @emf_char_frames[1] | |
sx = (index % 4 * @emf_char_frames[0] + pattern) * @cw | |
sy = (index / 4 * 4 + (((@character.direction * 2) % 10) - 2) / 2) * @ch | |
self.src_rect.set(sx, sy, @cw, @ch) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment