I want to set up a score, at the minute it is like a 10 digit random number the time works fine the code content is all thats needed below, how would I set it to 0 and implement it into an if function so score++ when collision with enemy happens, thanks!
I want to set up a score, at the minute it is like a 10 digit random number
your score is not initialized, no value has been asigned, so the bits where the memory is located are garbage, short: it has an undefined value unsignedint _plyr_score = 0; // assigns value, no garbage anymore
how do i [...] implement it into an if function so score++ when collision with enemy happens, thanks!
If you know when a collision happens you can just do it like this: