Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Dual Analog - Target Practice

Sign in to follow this  


[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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!