[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

How to keep effects of image filters going for some seconds?

Vincent Ren

3/21/2010 7:23:00 AM

Hello, every pythoner.

Firstly, I want to mention that English is my second language, so
maybe there are some sentences which makes you confused, sorry.

I have been learning Panda3D, an open source 3D engine, these days.
Now, I'm trying to write a small game for fun and practice. However,
I've ran into a problem.

I want to make some speical effects and there is my code:

def ventose(self):

global potato_HP

if potato_HP[0] == 1 and potato_HP[1] == 0:
if random() > .30:
self.filters.setCartoonInk(separation = 0.8)
self.robotVincent.resetHead.start()
self.decreaseVincentHP()
Wait(3)
self.fliters.delCartoonInk()

However, it doesn't work, the CartoonInk effect will never been shown
in my game and I don't want my game to wait three seconds, what I need
is to keep the effect for a period of time while the game run as well.

Besides that, I also want to show a counting back like "3", then "2",
then "1", finally "Go".

As a beginner, I don't know how to do them properly.

Please give me some directions, thank you.


-----------------------------
Vincent Ren

2 Answers

donn

3/21/2010 11:08:00 AM

0

On 21/03/2010 09:23, Ren Wenshan wrote:
> I have been learning Panda3D, an open source 3D engine,
Ask on the Panda3D forums, you will get good help there.

\d

Terry Reedy

3/21/2010 10:01:00 PM

0

On 3/21/2010 3:23 AM, Ren Wenshan wrote:
> Hello, every pythoner.
>
> Firstly, I want to mention that English is my second language, so
> maybe there are some sentences which makes you confused, sorry.
>
> I have been learning Panda3D, an open source 3D engine, these days.
> Now, I'm trying to write a small game for fun and practice. However,
> I've ran into a problem.
>
> I want to make some speical effects and there is my code:
>
> def ventose(self):
>
> global potato_HP
>
> if potato_HP[0] == 1 and potato_HP[1] == 0:
> if random()> .30:
> self.filters.setCartoonInk(separation = 0.8)
> self.robotVincent.resetHead.start()
> self.decreaseVincentHP()
> Wait(3)
> self.fliters.delCartoonInk()
>
> However, it doesn't work, the CartoonInk effect will never been shown
> in my game and I don't want my game to wait three seconds, what I need
> is to keep the effect for a period of time while the game run as well.

The generic answer is to turn CartoonInk on and set a timed event for
now+ 3 secs to turn it off. You will have to understand how to interact
with the Panda event loop. For a more specific answer, follow Donn's
advice -- Panda forum. I know there was one when I looked at Panda a
year ago.

> Besides that, I also want to show a counting back like "3", then "2",
> then "1", finally "Go".

Ok, instead to events set 1 sec in future.

Terry Jan Reedy