Thanks for the help.
And yeah I'm using OpenGL with glut... at least till I learn the basics.
Search found 14 matches
- Sat Jan 15, 2011 7:04 pm
- Forum: Programming Discussion
- Topic: Can't break out of for loop?
- Replies: 5
- Views: 689
- Fri Jan 14, 2011 2:14 pm
- Forum: Programming Discussion
- Topic: Can't break out of for loop?
- Replies: 5
- Views: 689
Re: Can't break out of for loop?
Elaborate?....pleaseN64vSNES wrote:Timer?
- Fri Jan 14, 2011 11:48 am
- Forum: Programming Discussion
- Topic: Can't break out of for loop?
- Replies: 5
- Views: 689
Can't break out of for loop?
For some reason, hopefully a simple mistake, all my bullets are shooting at once. I really don't see anything wrong so I figured I would come here. Heres the bullet coding. (yet to put in any velocity or frame rate smoothing) #define BULLETS 5 class Bullet { public: Bullet(); void Update(); void Fir...
- Fri Dec 31, 2010 1:06 pm
- Forum: Programming Discussion
- Topic: Accessing class object member pointer variables
- Replies: 6
- Views: 593
Re: Accessing class object member pointer variables
Ohh that makes sense. Thanks again for you help.
- Fri Dec 31, 2010 12:05 am
- Forum: Programming Discussion
- Topic: Accessing class object member pointer variables
- Replies: 6
- Views: 593
Re: Accessing class object member pointer variables
If you need to do something extra for using the pointer then that's my problem. class Bullet { public: float x; float y; float radius; void bDisplay(); Bullet(float, float, float); }; Bullet::Bullet(float xx, float yy, float rr) { x = xx; y = yy; radius = rr; } void Bullet::bDisplay() { glBegin(GL_L...
- Thu Dec 30, 2010 9:15 pm
- Forum: Programming Discussion
- Topic: Accessing class object member pointer variables
- Replies: 6
- Views: 593
Re: Accessing class object member pointer variables
Thanks for the reply
Thats what I originally had, but it gave the error "request for member 'y' in 'aBullet', which is of non-class type 'Bullet*'
Thats what I originally had, but it gave the error "request for member 'y' in 'aBullet', which is of non-class type 'Bullet*'
- Thu Dec 30, 2010 8:55 pm
- Forum: Programming Discussion
- Topic: Accessing class object member pointer variables
- Replies: 6
- Views: 593
Accessing class object member pointer variables
I have class "Bullet" with x and y declared as public variables. I need to create objects of the class within the program so I tried using a pointer: Bullet *aBullet = new Bullet(ship.x, ship.y + 20, 10); When trying to call the y variable (Bullet::bBullet.y <<< not sure if this is right) ...
- Mon Jul 26, 2010 7:36 pm
- Forum: Programming Discussion
- Topic: [Solved] NCurses and Typewriter Text (XCode,C++)
- Replies: 2
- Views: 673
Re: NCurses and Typewriter Text (XCode,C++)
Thanks a lot! Worked perfectly. I'll post the working code for future reference: void twtext(char text[]) { raw(); int twdelay = 35; if (strlen(text) >= 25) twdelay = 10; else twdelay = 35; int cb; int i = 0; nodelay(stdscr, true); while ((cb = getch()) && (i < strlen(text))){ if (cb > 0) { ...
- Mon Jul 26, 2010 6:34 pm
- Forum: Programming Discussion
- Topic: [Solved] NCurses and Typewriter Text (XCode,C++)
- Replies: 2
- Views: 673
[Solved] NCurses and Typewriter Text (XCode,C++)
I'm trying to create a typewriter effect for a console app and I'm having some trouble with a part of it. I can get the text to display one letter at a time, but I'm having trouble ending the loop if a keypress is found and print the rest of the text. I started with a for loop then went to a while t...
- Sun Apr 04, 2010 11:09 am
- Forum: Programming Discussion
- Topic: Using class object member variables based on other members
- Replies: 7
- Views: 860
Re: Using class object member variables based on other member it
Thanks for the help. This is the preferred method, but I'm not sure where your unique IDs are coming from. I probably should of put more into the example code. This should explain the id's a little better. class testClass { public: int id; int diff; static size_t count; testClass(int); }; size_t arm...
- Sat Apr 03, 2010 11:33 pm
- Forum: Programming Discussion
- Topic: Using class object member variables based on other members
- Replies: 7
- Views: 860
Using class object member variables based on other members
I need to search through a class to find the object who's "id" member variable matches a value. This class object's other member variables will be used for a calculation, but only if the "id" equal. This concept code might help in understanding what I'm trying to do: class testCl...
- Fri Apr 02, 2010 12:11 pm
- Forum: Programming Discussion
- Topic: C++ Typewriter text effect (xcode)
- Replies: 3
- Views: 1636
Re: C++ Typewriter text effect (xcode)
Thanks for the help. Nanosleep worked for delaying, but it for some reason when the timer is up instead of only printing one letter it prints the whole line of text. Even when I use a while loop for a delay it does the same thing. The code is showing the use of the while loop with the nanosleep meth...
- Fri Apr 02, 2010 11:15 am
- Forum: Programming Discussion
- Topic: C++ Typewriter text effect (xcode)
- Replies: 3
- Views: 1636
C++ Typewriter text effect (xcode)
I am making a console app (using a mac and xcode), and I wanted to add a typewriter effect to text. I thought it would be a pretty simple task, but when I run the app the console freezes when it reaches the function. It still accepts user input, but it doesn't continue. #include <iostream> #include ...
- Thu Apr 16, 2009 11:59 pm
- Forum: Programming Discussion
- Topic: Ncurses help
- Replies: 1
- Views: 303
Ncurses help
Well I started learning c++ today after being inspired by them. I decided to begin with a console rpg. But after getting half the game done, I decided that I wanted a better console experience. I did some research and found ncurses. I installed and started playing around with it. This code has some ...