Hot answers tagged

2

Irene is right to suggest what she did, but that's not your problem. Your code is detecting a collision between the ball and the score. When it detects the collision, it removes the object, which happens to be the score. Also, since the ball starts out in the same position as the score (maybe a poor design choice in itself) and hides it, the collision is ...


2

To make with different file name, we have to add a line into Makefile that is inside the same directory for example in my case: labelTest1: labelTest1.c Makefile clang -ggdb3 -Ispl/include -O0 -std=c99 -Wall -Werror -o labelTest1 labelTest1.c -Lspl/lib -lcs -lm See a screenshot: Here is the screenshot when I run with make labelTest1.c


1

The cause of the error is that the compiler is unable to locate the gobjects.h header file. This file resides in the spl/include folder. The other programs, such as label and breakout, can be compiled because the makefile instructions for the compiler (actually the pre-processor) on where to locate the .h files. You can see this working when you run make ...


1

You haven't set the location where the label is supposed to appear in initScoreboard. Do it like that: setLocation(label, x, y);


1

Looking at your code, I see two issues. First, you call initScoreboard twice, once before starting the while loop and once just inside the loop, without assigning the object to a variable. Instantiating the scoreboard once should be enough. I think that doing it with every pass through the loop will just cause problems. // instantiate scoreboard, centered ...


1

Because the last char in the array is the NULL character ('\0') to signify the end of the string. You always need a string of length + 1 characters to account for this NULL character.


Only top voted, non community-wiki answers of a minimum length are eligible