Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 *is new* Need help with FPS. need way to make enemy die DKIP
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
LastHunter




PostPosted: Tue Mar 16, 2004 10:15 pm   Post subject: *is new* Need help with FPS. need way to make enemy die DKIP

Hey every1 I'm new so if I sound like I don't know anything about Turing, it's cuz I don't. Crying or Very sad
Anyway, I'm trying to make a FPS (first person shooter)
Thanks to tony's awesome character control on screen tutorial I have it so you can move an aiming reticle around on screen, and when you press a button it flashes, plays an explosion sound effect and there's an animation of a gun firing. . . Anyway, what I need to know is after I have the enemy appear on screen how do I make it that
a) the enemy dies when I align the aiming reticle and fire and then have the enemy vanish or replaced by a ms paint picture of a dead enemy or whatever and
b) have the enemy attack and have you (the user) take damage.
Is that even possible with Turing? Sad
Sorry if I didn't explain that well enough Crying or Very sad and sorry if I didn't put enough info on the topic title Crying or Very sad im new!
THANKS IN ADVANCE FOR YOUR HELP 8)
Sponsor
Sponsor
Sponsor
sponsor
poly




PostPosted: Tue Mar 16, 2004 10:49 pm   Post subject: (No subject)

A) Hmmm well you could write a procedure (if statement if you must) that checks to see if mouse X and Y cords are on enemy and if you fire while there on him than he clears (or shows an image of him dead)

B) Yes its possible. Just make enemy throw something/shoot at you and if it hits you than you take damage away from a health meter. when health meter=0 your dead
Paul




PostPosted: Tue Mar 16, 2004 10:52 pm   Post subject: (No subject)

dunno if this is the right way to do it:
use if statement to check when mouse button is down, if the enemy is clicked, you can use coordinates or whatdotcolor to do this, then when it confirms the hit, clear screen, or draw whatever BG color the draw the dead pic.
AsianSensation




PostPosted: Tue Mar 16, 2004 11:42 pm   Post subject: (No subject)

since you are new, I'll give an advice: Dont use whatdotcolor for your detection.

instead, keep track of the position of each enemy. If your mouse clicks within that range, then the enemy is considered hit. If it's hit, then you can have a boolean variable that keep track of it being alive or dead, turn it dead if it's hit, and then at the bottom of the loop, where you are drawing all the pictures, draw according to the flag. So example being, if the flag is true, draw the enemy standing, if the flag is false, draw the enemy dying.

as for them hitting you, it's simple too. Have you ever played that sniper game? The enemies are given a certain amount of time before they fire, and as soon as they fire, you take damage, then their time counter resets, and the process starts over again. Do something like that.

Don't underestimate turing, it'll sometime surprise you with the amount of stuff it can do.
recneps




PostPosted: Wed Mar 17, 2004 11:03 am   Post subject: (No subject)

ooo asian, dodge wont be happy bout that Wink

Anyways, i think the easiest way of seeing if hit is using Math.Distance, like this
code:
if Math.Distance(mousex,mousey,enemyx,enemyy) <10 then %whatever enemy width is would be the 10
put "enemy was hit"
end if

Math.Distance compares the distance between 2 points, (mouse x and y, and enemy x and y in my example)
its the same as the distance formula from math:
d=square root(x^2+y^2)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: