C#/Directx programming help needed (Missile Command game)

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px For my Uni project I need to recreate an arcade game, I have chosen Missile Command.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px I have lots of the things that I want working but I cannot get the players bullet (blue missile in the game/Bullet.cs) to fire from the base (the blue
triangle at the bottom/Base.cs) towards the crosshair. So far the missile fires to the crosshair but from directly below where the crosshair is placed and not from the base (the triangle/Base.cs).<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px Other things that I have no idea on getting to work is making it so that the mouse is used for the crosshair control, with left click being the fire
button. At the moment I have it set to W, A, S, D for movement and Space for firing. As well as adding a timer to the red rockets (NewRocket.cs) so that they all dont spawn at the same time.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px This project has a hand in date (Monday, 28th, May) so any suggestions are more than welcome. I am also not asking you to do it for me (unless you want
to write the code out) I just would like someone to explain how to do it/write the algorithm to get it to worth as this is the first "big" programming project I have got and I am not very experienced with C# or Directx.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px I use Visual Studio 2008, C# and Directx programming languages in this project.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px Please ignore the missiles (the red ones/NewRocket.cs) falling from the sky this is supposed to happen, I just have not implemented a timer to space
them out yet.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px Here is the rar file with the program/game and the sprites for the missile etc...<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
http://www.filefactory.com/file/1qxr8dfqfqbp/n/Missile_Command.rar http://www.filefactory.com/file/1qxr8dfqfqbp/n/Missile_Command.rar <br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px To get this to run you will need to change the location of the images on lines 135-169. Make sure you place two back slashes (\) after/before each folder/file.
If anyone also knows how to make it so that I do not have to change the file paths and have the sprites within the program/game folder please let me know.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px Thanks for any help and feel free to ask questions for more information, I will reply to all of them and will be checking this frequently.<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<br style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px
<span style="color:#333333; font-family:arial,helvetica,clean,sans-serif; font-size:13px; line-height:16px Thanks.

View the full article
 
Back
Top