Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   how do i make a gun reload? (http://www.alice.org/community/showthread.php?t=2550)

Coreyjames25 04-20-2009 02:43 PM

how do i make a gun reload?
 
ok so I have a revolver from the old west class. and than a sphere set as a vechile to the barrel of my reolver. this is my ammunition and at this point I have it move forward 500 meters than set opacity to 0 and move back to the barrel in 0 seconds and opacity back to 100. than I click to shoot. my question is how do I make it shoot faster and after 6 shots I want it to reload. I hope this makes sense.

Gamma God 05-08-2009 07:24 AM

well you must make a method for the reloading prosses and in the same method chech if the user has shot 6 times use a number variable under the World Properties tab.

So you might use a while loop to repeatedly check with an If Else statement, but instead of just (If TRUE do this or that, else do nothing) you might use ( If world.Stop is = 6 then) and methods would follow to show your animation for reloading the revolver. if you need more help I'll be checking regularly...;)

Scott300 05-08-2009 08:43 AM

while true
{
if world.ammoleft <= 0
{
set world.ammoleft == 5
ammo1 move to gun
ammo2 move to gun
ammo3 move to gun
ammo4 move to gun
ammo5 move to gun
}
}

vazin 05-22-2009 04:11 PM

[QUOTE=Coreyjames25;9780]ok so I have a revolver from the old west class. and than a sphere set as a vechile to the barrel of my reolver. this is my ammunition and at this point I have it move forward 500 meters than set opacity to 0 and move back to the barrel in 0 seconds and opacity back to 100. than I click to shoot. my question is how do I make it shoot faster and after 6 shots I want it to reload. I hope this makes sense.[/QUOTE]

AN extremely elegant example is posted by [B]x2495iiii[/B], called InfernoValley posted on my site
tech4dreams.com

The Java3d version has some bugs, but works perfectly on a2w

Hope is useful information

Cheera


All times are GMT -5. The time now is 09:00 PM.

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