Animated layeredimage without repeat

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Exiscoming
Regular
Posts: 132
Joined: Tue Apr 29, 2014 5:37 pm
Contact:

Animated layeredimage without repeat

#1 Post by Exiscoming »

So I asked this question a few days ago and got an answer, but I've run into a new problem.

Code: Select all

image enemy1:
	"enemy1.png"
	alpha 0.0
	linear 1.0 alpha 1.0
	repeat				# <- The problem

layeredimage battle:
	always:
		"background1.jpg"
	if enemy1 == 1:
		"enemy1"  xalign 0.5 yalign 0.7

label start:
	show battle
	$ enemy1 = 1			# enemy is introduced into the battle
I would like an enemy to fade in during battle and that works with the above code.
The problem is the repeat. Obviously the enemy only had to fade into the scene 1 time, however the above code doesn't work without the repeat.
Instead it instantly jumps to alpha 1.0 without waiting one second.

User avatar
qirien
Miko-Class Veteran
Posts: 542
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Animated layeredimage without repeat

#2 Post by qirien »

Do you need an "on show" statement here? Like:

Code: Select all

image enemy1:
	"enemy1.png"
	on show:
		alpha 0.0
		linear 1.0 alpha 1.0
Finished games:
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users