Skip to content

Instantly share code, notes, and snippets.

@HimeWorks
Created April 6, 2015 18:08
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save HimeWorks/8618372e856646c0580c to your computer and use it in GitHub Desktop.
Eight-Dir Movement patch for Modern Algebra's Extra Movement Frames
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