polymarsdev / cursor-custodian Goto Github PK
View Code? Open in Web Editor NEWA small SDL2 game made in 48 hours
A small SDL2 game made in 48 hours
In player.cpp, Player::getScore and Player::getHighScore return pointers to dealocated memory.
const char* Player::getHighscore()
{
std::string s = std::to_string(highscore);
s = "BEST: " + s;
return s.c_str();
}
const char* Player::getScore()
{
std::string s = std::to_string(score);
s = "DISTANCE: " + s;
return s.c_str();
}
When std::string s goes out of scope, the const char* that s.c_str returns is invalidated. Access to the underlying string may be garbage, cause a segfault, or cause other nasty issues.
Hi Polymars, im actually trying to use your game but i can't because the libstdc++-6.dll is missing, thx for reading my issue and have a good day !
It is always good to see a developer putting their code out there and welcoming collaboration.
And I think this game has a lot of potential.
But, copyright laws being what they are, for people to be comfortable making major contributions, or packaging this game for binary distribution (so that people who don't know how to compile from source can play it off line too), there needs to be a real license that makes the conditions clear.
It would be great if you would adopt the GNU GPL, or Apache / MIT / BSD license.
These are free software licenses and would attract members of the free software community to your project.
You can also use this site to help you choose: https://choosealicense.com/
when I compile using emscripten this error happens: shared:ERROR: unclosed opened string list. expected final character to be "]" in "['png']""
In renderwindow.cpp, there are some functions that render text, specifically the function "renderCenter" and the last overload of "render" (the one that starts on line 87). I noticed that they create an sdl_surface and copy it to an sdl_texture. The surface is freed at the end by a call to SDL_FreeSurface, but there is no call to SDL_DestroyTexture for the texture.
This leaks memory significantly slower than Twini-Golf did, which is why it probably hasn't been noticed.
Could you port the game to Linux? Thanks!
Hello!
It seems like you forget to destroy your renderer
in the void RenderWindow::cleanUp()
method.
SDL_DestroyRenderer(renderer);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.