Dual Analog - Target Practice

posted in SteelGolem
Published December 19, 2004
Advertisement
[journal dump]

i want to do the timing now. [working] i had to go look it up. apparently you go with timeNow = DateTime.Now; and find the elapsed time with timeElapsed = (timeNow - timeLast).TotalSeconds; [working] ok, i added bullet support. press any button and the bullet fires. i can add a noise now to that if i wanna. lets go back to the list we made up last time. [working]

todo list:
- limit face motion radially, not with cartesian (like crosshairs)
x add timing
- finish actual game >> elaborate <<
- sound effects
x compare atan2-sin-cos vs sqrt methods
- dead-zone the analog sticks

i'm getting closer to the game part being done. getting the bullet going was one step. i wrote it all as commented code (the comments actually stayed in the code, i just coded around them) there's nothing being doen with any collision between the bullet and the target yet because the collision detection routine isn't written yet - it just returns false all the time.

i changed back to the sqrt method because i wanted to use some of the stuff we got out of it. it came in handy when i wanted to direct the bullet. i'm going to need to go back through the code and make it more readable. its a mess.

as i played with it a bit more, i realized that the bullet is coming from the upper left of the face. that's not right. we need to offset it a little to make it come from the middle of the face. thats gonna be easy.

todo list:
- limit face motion radially, not with cartesian (like crosshairs)
- finish actual game (need to specify more)
- sound effects
- dead-zone the analog sticks
- refactor the code for readability
- make bullet come out of middle of face instead of top left corner

i'm gonna fix the bullet start loc first. [working] fixed. i wasn't initing the bullet's sprite - and then i did, but i did it wrong. so that was a bit of fun. i should eventually introduce a vector class soon to make my job even easier. lets look at what we need for a finished game.

we need to have the bullet collide with the target. when that happens, the score goes up by one point. we might have a sound effect play there, like a crash or explosion or something. the target will be moved somewhere randomly on the window, and you have to shoot it again. we'll have a 1:00 min timer counting down to zero and when it gets to zero, its game over. we need to display the score and the timer to the player as they play.

i'll do the collision test routine next.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement