Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Reverse Loop Sprites
Started by matteocabe Jun 13 2018 11:20 PM

- - - - -
1 reply to this topic
sprites
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

matteocabe

[GLOBAL: userInfoPane.html]
matteocabe
  • Observer

  • 1 posts
  • Corona SDK

Hi everybody,

 

I'm a newbie with Lua and I have a problem.

I'm inserting a sprite of a girl walking, but when I try to loop her back it doesn't work.

 

	local eroeSheet = graphics.newImageSheet("img/livellocamera/camminata.png", opt)
	local seqs ={{
							name = "runLeft",
							start = 21,
							count = 20,
							time = 800,
							loopCount = 0,
							loopDirection ="forward"
							},
							{
							name = "runRight",
							start = 1,
							count = 20,
							time = 800,
							loopCount = 1,
							loopDirection ="forward"
							}
						}
	eroe=display.newSprite(camera,eroeSheet,seqs)

This is my code, am I missing something?



[TOPIC: post.html]
#2

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 626 posts
  • Corona SDK

Is this all the code you have? Where and how are you calling the sequences? I would also set both loop count to 0. 

 

This is a fairly old video but it will give you some ideas:

 




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: sprites