While I haven't reached the point where I can test this out myself, I believe having two signed variables for velocity (x and y) would do the trick. While this doesn't account for a change of speed...
Type: Posts; User: ruthgrin
While I haven't reached the point where I can test this out myself, I believe having two signed variables for velocity (x and y) would do the trick. While this doesn't account for a change of speed...
I realise I may be making an unknown number of incorrect assumptions here, but assuming that the inventory holds objects of type Item and that there is a ceiling to the max inventory size that is...
void GetPopulation(int (&Output)[21], int (&Pop)[PopSize][21])
{
int index;
int j;
/*
This next loop only runs while the value of index is greater than Popsize. Since...
After yet another look through, I realized that there was at least one more error where you assign the values for the corners. Perhaps you could try assigning the corner locations inside each box...
top1 = object1->y1+ object1->col_y_offset;
top2 = object2->y1 + object1->col_y_offset;
bottom1 = object2->y1 + object1->col_height;
bottom2 = object2->y2 + object2->col_height;
...
Just followed your advice and the problem seems to be fixed.
I couldn't find anything about an operator>> for use with strings in my documentation on istream so I assumed that I would have to...
I've done a little program which reads in info from a text file, but there seems to be a problem when I try to output certain numbers.
Code for the program in question:
#include <iostream>...
I wasn't sure whether in the post
'header' was referring to the file the declarations were in, the declaration of the class or its member functions, or something else. Since I'm used to...
I've gotten it to compile and not found any (new) problems.
I ran a check in the glossary on this site and couldn't find either of them. Can you please explain what exactly they are/represent?...
I recently tried cleaning up my code by separating it into smaller files and separating class member function declarations and definitions to get around issues relating to 'class has not yet been...
Maybe everyone made a new year's resolution to learn C++/make a 3D game, without realizing the effort involved?
I'll try to remember those points.
My orginal intention was simply to make a more space efficient method of achieving runtime polymorphism, even if it was not quite as fast (since none of my...
My fault for not explaining. This was a stand-alone example to determine the performance differences, so it consisted of, in effect, two classes each done two different ways. The v classes are...
In reply to Rashakil Fol, I compile with single-byte alignment so my variables don't have any padding, though I was unaware of the performance implications.
As for 'macro insanity'/inlining and...
The idea is 'runtime polymorphism' without virtual pointers or (by implication) virtual functions. Instead, each class object is given a type value. When a function is called through a base-class...
Maybe I should have explained differently. I'm referring to the amount of space required for the information used for runtime polymorphism, not executable size (besides, I probably ought to learn how...
I've been working on an alternative method to virtual pointers to achieving runtime polymorphism, with increased space efficiency being the primary concern. While this was simple enough, I found that...
I think I've got it working, though I haven't found as many bugs as I expected. Still, that's my problem for now.
I know, what I'm trying to do is overload the operators to work with the pointers, but due to the assignment operator being a member function, I don't know how to have the pointer as the left...
I'm currently attempting to simplify the use of my 'data-type' (var_var) by overloading operators in relation to it. First, an example of its usage:
class Test { // The test class.
public: //...
I believe this information will prove enriching, as will the (diversity of terminology?) in your replies. While I am currently encountering other problems in relation to making my little project work...
I would've posted sooner, but I've been a bit occupied. Since my previous attempt at a post just went up in smoke, I'll be comparatively brief.
Within a minute of logging off. I've since been...
I usually have trouble explaining what I'm thinking. I'll try elaborating.
Reply 1:
I'm really confused by what you are trying to do. So you want to allocate space for the struct based on the...
My apologies in advance if this is the wrong place for this.
I'm currently in the early stages of developing a game, specifically creating the 'building blocks'. With this game being turn-based, I...