PDA

View Full Version : need urgent help


intel8080
12-13-2011, 04:36 PM
please, could some one tell me, that how can i reload bullets and how can i set each bullet false by firing every time...

suppose, i have 5 bullets..every time i fire, each bullet should be vanish accordingly, how can i make this method?

TauTrumpsPi
12-14-2011, 01:52 PM
What I would do is make a variable called Counter, the increase it by 1 every time a bullet is fired. After that, make a bunch of if/else statements to see which number counter is at, and under those if/else statements set the proper bullet to isShowing == false.

dakota95
12-14-2011, 02:05 PM
please, could some one tell me, that how can i reload bullets and how can i set each bullet false by firing every time...

suppose, i have 5 bullets..every time i fire, each bullet should be vanish accordingly, how can i make this method?

would using one bullet work? It would work faster than multiple bullets and it is easier. You could just tell it to move back to the gun a split second after it is fired. The only problem with it, is that there is no limit to the amount of times you can fire.

waqar
12-19-2011, 02:59 PM
I guess this maybe helpfull for u :)

Joker899
12-19-2011, 10:07 PM
Having bullets move back and forth between the gun tends to not work. The bullets ignore frames and any detection or bullet collision you had is ineffective.

Usually I use a method similar to this: http://www.alice.org/community/showthread.php?t=4861

That's the basic bullet collision detection I use (Look for the cone in the objects, that is the detector).

Also to keep track of bullets I use a number variable and some 3D text.

Lets say for example I use

3dtext set value (int (world.bulletvariable) as a string)


Use this in a infinite loop and it will keep track of your ammo.
Have the default setting of the variable be your max ammo in clip.
Now whenever you shoot just drag the variable in the shoot mechanism and choose decrement (world.bulletvariable) by 1. This will then adjust your ammo accordingly.

When you reload, just drag the variable into the reload mechanism and have it set (world.bulletvariable) to (30 or whatever your max ammo is)

Works like a charm. If I went a bit off-topic--sorry. Hope this helped.

waqar
12-20-2011, 08:57 PM
believe me why go hard when u can do it in an easy way check out the FPS i made its working pretty cool w/o this bulllet detection thing i set that if mouse clicked on enemies do following methods check it out
http://dl.dropbox.com/u/52144883/COUNTER%20AT%20KIET.a2w:)

for screen shots and other link go here

http://alice.org/community/showthread.php?p=44966#post44966