animations with love2d

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Seth144k
Prole
Posts: 29
Joined: Wed Jan 19, 2022 8:45 pm

animations with love2d

Post by Seth144k »

Hi so im using this amazing library for love2D called anim8 its pretty good but im having alot of trouble with flipping for the left animation... I have no clue where to start and I attempted this using a number of diffrent ways but to no luck... i hope one of you can help me please
Attachments
main.love
(900.56 KiB) Downloaded 68 times
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: animations with love2d

Post by ReFreezed »

Try setting animation.flippedV to true/false, or specify a negative x-scale value (sx) when you call animation:draw().
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
knorke
Party member
Posts: 260
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: animations with love2d

Post by knorke »

Folder animX has a captial X but in code there is animx = require("animx") with lowercase x. That makes it fail on sytems that are casesensitive:
main.lua:1: module 'animx' not found:
no field package.preload['animx']
no 'animx' in LOVE game directories.
The character is flickering when moving to left direction because he is quickly flipping between left&right orientation.
in function player:update(dt)

Code: Select all

 if love.keyboard.isDown("a") then
        self.x = self.x - self.speed * dt
        self.anim:flipH() 
        self.isMoving = true
every frame when "a" is hold down, flipH() gets called. You only want to call it once, when the dude begins moving to the left.
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests