Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.