Turret
I need to make a turret for a game. The turret will fire bullets and hit objects moving towards it. The turret's chamber can move within a 120 degree field. I've never done any animation and any help would be much appreciated. Key Bindings are left, right, up and down, and space to shoot. Please help me!
[314 byte] By [
HelpMEa] at [2007-11-26 15:24:34]

# 1
So what do you have so far? If you haven't done anything yet, then start by modelling the turret's behavior and attributes, then do the animations. Your Turret object will have an amount of ammo, a direction of fire, a rate of fire, etc. Create methods to rotate it, only allowing it to move 60 degrees to the left or right. Create a method to fire a bullet, which decrements the amount of ammo, only lets it fire so often, etc. Once you've got this done and tested, start working on animating it. You'll have getters in Turret that let the animation controller find out what angle the barrel's is pointing, if it's currently firing, etc.
Start writing the code and post it if you get stuck.
# 2
You don't need help, you need someone to program this for you.
# 3
Uhm. Prometheuzz.
Stop treating people like ****. Every post you were involved with, you would rip people to shreds. please stop.
Now to answer your question.
Aside all the true things that Hunter said, you must save all objects into a List. Why? have the list store the bullets each time they're created and then iterate the list to see if the bullet is colliding with anything. but you must create all of hunters steps first.
good luck.
# 4
> Uhm. Prometheuzz.
> Stop treating people like ****. Every post you were
> involved with, you would rip people to shreds. please
> stop.
I will post whatever I want. I think you're a bit ticked of because I criticized some of the answers you posted. If you can't stand being criticized, this is no place for you.
# 5
Do you know trigonometry? If you know the turret length and the angle that it's at, you can use sin and cos to figure out the two endpoints of the turret.
# 6
> Uhm. Prometheuzz.> Stop treating people like ****. Every post you were> involved with, you would rip people to shreds. please> stop.The OP came off like he wanted us to do it for him, that's why prometheuzz responded like that.
# 7
> > Uhm. Prometheuzz.
> > Stop treating people like ****. Every post you were
> > involved with, you would rip people to shreds.
> > please stop.
>
> The OP came off like he wanted us to do it for him,
> that's why prometheuzz responded like that.
Correct.
@ArikArikArik:
Ripping to shreds? Are you mad? (don't anser that last one, I already know.) Was I cursing to the OP or calling him names? No.
The OP just posted his assignment (or goal) without showing any work done by him/herself and asking for help. I do not call starting from scratch for someone helping. Thats called doing someone else's work. Hence my suggestion to the OP to find someone who will do this for him.
Your contributions here on the forum are of less value than mine, IMHO. Almost every crappy line of code you post is full of errors, and is very confusing due to the fact you don't use any sort of code convention.
# 8
> Your contributions here on the forum are of less
> value than mine, IMHO.
I have to say it's in my opinion as well.
> Almost every crappy line of
> code you post is full of errors, and is very
> confusing due to the fact you don't use any sort of
> code convention.
It's not even like he is using a different convention, he just makes it up as he goes along.