After implementing collision detection, timing for animation, and a few other things, I've realized that the way I implement gravity doesn't fit in with my collision detection.
... the reason...
Type: Posts; User: misterFry
After implementing collision detection, timing for animation, and a few other things, I've realized that the way I implement gravity doesn't fit in with my collision detection.
... the reason...
I used a 10 millisecond deltaTime wait between each redraw of the object, and increased the velocity by 9.82*deltaTime each frame.
Thanks for the help.
Would you include every single pixel as a step when moving the object toward the point of gravity or is that overkill or even practical?
If every pixel on a 800x600 screen was modeled as one foot,...
I need a little direction on how to handle gravity.
What is the best way to implement acceleration due to gravity for a falling object? More specifically, how should each check/iteration on the...
I'm writing a program that reads some files. The first file contains a list of data for books, and the second file contains information for markets from where the books are bought. The first file has...
I've solved the problem. In another program (the final for the course) where I was doing the same 'getline()', I discovered that the length of separate strings (getline vs. cin[ifstream]) were...
edit:
WS isn't a variable, it's a stream manipulator. They both work, but now whenever I try to output the variables, i get a list of 8 items, and then when outputting the price, they overwrite...
Thanks for the tip.
It's working fine with that.
I'm writing this program that reads a text file which lists an item, and then it's price, and on and on...
This is part of the code... the problem I'm having is reading the file. With this...
As far as I can tell, it was because i wasn't assigned a value when declared. I set it to zero and can add all the variables I want now. As far as reading initially before a while loop, I read...
32570!
Well, that's the first time I've ever run into a problem when not assigning a value to a variable when declaring it. I always figured it was unnecessary to do, but got into the habit of it...
76
89
150
135
200
12
100
28
178
189
I figured as much. I'll just paste the whole code since it's relatively small. This is an assignment for a course, which should be obvious... :)
This program reads from a file with multiple lines...
Has anyone encountered a situation where simply declaring an additional variable causes a segfault when reading a file? I have the following int variables declared:
int array[20], i = 0,...
Ok, thanks for the replies. After nothing else worked, I just used a for loop to get what I needed from the array.
int i;
for (i = 0; i <= 8; i++){
cout <<...
Well, it's not technically part of the assignment. I just wanted to fool around with the 2d arrays because half of the chapter is about them. My program is working fine now, but it's just the section...
I'm using the following code to put the contents of a a file into a 2D array.
getline(readFile, line, '\n');
while (!readFile.eof())
{
strcpy(getTheLine[s], line.c_str()); ...