Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Double Click
Old
Lothp
Junior Member
 
Status: Offline
Posts: 3
Join Date: Apr 2012
Default Double Click - 04-23-2012, 10:00 AM

I am currently working on a program that has zombies walking on the moon that after all are shoot the words the end appear. All of that works fine, but there is one bug that I can't fix. When the user clicks on the zombie he disappears and then makes a grunting noise. After this 1 is subtracted from the total number of zombies and when that number reaches 0 the words The End appears. However, if the user gets trigger happy and shoots the zombie twice, or more, before it disappears it counts it as being shoot twice. Is there a way in Alice to stop the user from double clicking on objects?
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 04-23-2012, 10:13 AM

are you making the zombies setting to false or their opacity to 0%?


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Old
Lothp
Junior Member
 
Status: Offline
Posts: 3
Join Date: Apr 2012
Default 04-23-2012, 10:19 AM

When the zombie is shoot the opacity is set to 0% for a duration of .25 seconds.
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 04-23-2012, 02:55 PM

Quote:
Originally Posted by Lothp View Post
When the zombie is shoot the opacity is set to 0% for a duration of .25 seconds.
The problem is that the user can click on the zombies while they are turning opaque. Some theoretical fixes:

1. Use "set isShowing" to false duration 0 seconds

2. Make a list of zombies, and a corresponding list that is a boolean list that says "IsShot", and set isShot to true when the zombie is shot, and in the method where he is shot, make sure he is not already shot before he gets shot

first one is the easiest, but the second allows you to keep the fadeout.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Old
Lothp
Junior Member
 
Status: Offline
Posts: 3
Join Date: Apr 2012
Default 04-24-2012, 03:07 PM

Quote:
Originally Posted by TauTrumpsPi View Post
The problem is that the user can click on the zombies while they are turning opaque. Some theoretical fixes:

1. Use "set isShowing" to false duration 0 seconds

2. Make a list of zombies, and a corresponding list that is a boolean list that says "IsShot", and set isShot to true when the zombie is shot, and in the method where he is shot, make sure he is not already shot before he gets shot

first one is the easiest, but the second allows you to keep the fadeout.
Thank you, I used the first idea and it worked. Little bit simple, but my group loved the animation so that's good enough.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 04-23-2012, 11:02 AM

I'd add each zombie to an object list, then when they're clicked, check to see if they're in the list. If they are, remove them, play the death animation, and subtract 1. If not, do nothing.


(')>
   
Reply With Quote
Old
fourbros
Senior Member
 
fourbros's Avatar
 
Status: Offline
Posts: 476
Join Date: Nov 2011
Location: Right Behind You...
Default 04-23-2012, 12:49 PM

make them set to false after the set opacity.
Hope this helps


My avatar is from the anime "Hyouka".......

You've probably never seen it, much less heard of it.....

You should watch it........


print("Hello World")
This is python code.

Lakers > Clippers
Vikings > Packers
Cardinals > Brewers/Pirates/Cubs/Reds
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.