Information

How to make cat in little alchemy

How to make cat in little alchemy


We are searching data for your request:

Forums and discussions:
Manuals and reference books:
Data from registers:
Wait the end of the search in all databases.
Upon completion, a link will appear to access the found materials.

How to make cat in little alchemy for the first time?

Hello guys, i have made my first cat in little alchemy and i would like to know how to make it better. When i click the first button, the animation starts but when i click agn nothing happens.

Also my animation goes back to the start of animation instead of staying there for a while and then repeat.

I have the "animation controller.lua" file saved in the folder with the game and i made the button as this:

b2.x = w2.x

b2.y = -w2.y

b2.width = 50

b2.height = 50

b2.alpha = 0

b2.blendMode = "out"

b2.z = -60

b2.enabled = true

b3.x = -w2.x

b3.y = w2.y

b3.width = 50

b3.height = 50

b3.alpha = 0

b3.blendMode = "out"

b3.z = -60

b3.enabled = true

I think this problem is because i am trying to change the x and y position and width and height of b2 and b3 after they are already made. I was thinking about putting all the variables for b2 and b3 in a seperate file with.lua extension instead of the one with.xml extension.

So my question is how can i make my animation controller to make my cat appear agn instead of leaving it there?

Thanks.

A:

When you use b2.x = w2.x, w2 is the button that was just pressed. When you use b2.x, you are setting x to the button that was pressed in the previous frame.

To avoid this, use the self.x variable, so it will point to the pressed button.

b2.x = self.x

b2.y = -self.y

b2.width = 50

b2.height = 50

b2.alpha = 0

b2.blendMode = "out"

b2.z = -60

b2.enabled = true

b3.x = -self.x

b3.y = self.y

b3.width = 50

b3.height = 50

b3.alpha = 0

b3.blendMode = "out"

b3.z = -60

b3.enabled = true

self.x = -self.x

self.y = self.y

Another thing that I would recommend is using a texture instead of buttons to represent the cat. It will make your code much simpler and easier to manage. Also, using a texture will allow the cat to animate and move along with the player, even when the player is not holding down the buttons.


Watch the video: How to make a keyboard cat in little alchemy (May 2022).

Video, Sitemap-Video, Sitemap-Videos