| | |
Linked List Issue
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 6
Reputation:
Solved Threads: 0
I am trying to create a Space Invaders sort of game. I am using a linked list for the bullets that the player shoots and in the same list, there is also the enemies. I have a addNewEnemy Function which I run once in the main game loop. This adds lots and lots of enemies (as I expected).
How am I able to stabalise the amount of enemies being added?
Yes I have tried using Sleep(), it just made the game do everything the same but with a 2 second pause in between (I used Sleep(2000)). I have also tried using a for loop to create a delay but I just can't seem to get it to work.
Any ideas?
Thanks.
EDIT - I am using VS 2003 with DirectX
How am I able to stabalise the amount of enemies being added?
Yes I have tried using Sleep(), it just made the game do everything the same but with a 2 second pause in between (I used Sleep(2000)). I have also tried using a for loop to create a delay but I just can't seem to get it to work.
Any ideas?
Thanks.
EDIT - I am using VS 2003 with DirectX
Last edited by Oblique; Dec 13th, 2007 at 1:04 am. Reason: put in my compiler.
I though you added like 8 at a time (at the top) when the whole grid of them moved down one row?
C++ Syntax (Toggle Plain Text)
-----> v <----- v
•
•
Join Date: Oct 2008
Posts: 32
Reputation:
Solved Threads: 4
First of all, sorry for thread hijacking
I too need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color.
So I figured the invaders are 3 child classes from a parent 'Invader' class that will have the methods of painting, moving, etc. About the post of the thread creator, what's a link list for the bullets? Should I try the same as him and create an array that will store the position of the bullets (with a maximum of maybe 40 bullets, Is there a way to dynamically allocate memory for the bullets' position as they are created so I don't have an array of 100 and use only 40 for example?)
The game will have sounds and the demo we've been given uses the sound files from the same folder the .exe is in, so they're not embedded (if that's how you would call that) or anything of that sort. The .exe is also got an icon.
We've been using PaintBox to draw stuff on application forms so I think that's how it will be this time around too.
If you wish I can attach the demo folder.
Thanks in advance
I too need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color.
So I figured the invaders are 3 child classes from a parent 'Invader' class that will have the methods of painting, moving, etc. About the post of the thread creator, what's a link list for the bullets? Should I try the same as him and create an array that will store the position of the bullets (with a maximum of maybe 40 bullets, Is there a way to dynamically allocate memory for the bullets' position as they are created so I don't have an array of 100 and use only 40 for example?)
The game will have sounds and the demo we've been given uses the sound files from the same folder the .exe is in, so they're not embedded (if that's how you would call that) or anything of that sort. The .exe is also got an icon.
We've been using PaintBox to draw stuff on application forms so I think that's how it will be this time around too.
If you wish I can attach the demo folder.
Thanks in advance
![]() |
Similar Threads
- Removing an item from head of linked list (C)
- Help with Linked Lists with digits (C++)
- Sorted linked list help (C++)
- Linked List problem (C)
- Beginner with C++ and goofy run time problem with DBL Linked List (C++)
- Linked stack modification issue (C++)
Other Threads in the C++ Forum
- Previous Thread: Discrete solution help!
- Next Thread: New to C++ Few Questiond
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






