Git Product home page Git Product logo

twini-golf's People

Contributors

mandar1jn avatar polymarsdev avatar r15user avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twini-golf's Issues

distribution is still hard (can't launch on Win11)

Just came across your video on this - love it! High5 for the work and putting this together.

  • Downloaded latest zip from Itch.io page
  • Attempted to run binary
  • Missing libgcc_s_seh-1.dll
  • Missing libstdc++-6.dll
  • Game execution halts there

Screenshot 2022-01-01 093031

Screenshot 2022-01-01 093131

  • I'll attempt to build the source in something like Visual Studio to see if that helps? 🤷

Build system

How about a build system like GNU/Make or CMake?

Game is missing some DLL's

The itch.io download has some dll's missing, more specifically:
libstdc++-6.dll
libgcc_s_seh-1.dll
You can find them at the bin directory of mingw64.

Edit: it works normally on pc's with mingw installed because the dlls are in the system path

Some bugfixes to make it work on macOS Big Sur also (most likely fixes crashes on other systems as well!)

So I compiled this on macos. And it immediately crashed after clicking to start a game.
However after some debugging I found the issue is your getStrokeText and getLevelText functions return a pointer to a std::string that is destructed in the function. A quick hack/fix for this, was to define them as globals so they stay in memory. Then the game works also on my macbook on catelina ;)

Here's the patch:

//reserve string in memory that does not get deleted
//as were returning char* from this!
std::string stroke_text="";
std::string level_text="";

const char* getStrokeText()
{
  stroke_text="";
	int biggestStroke = 0;
	if (balls[1].getStrokes() > balls[0].getStrokes())
	{
		biggestStroke = balls[1].getStrokes();
	}
	else
	{
		biggestStroke = balls[0].getStrokes();
	}
  std::string s = std::to_string(biggestStroke);
	stroke_text = "STROKES: " + s;
	return stroke_text.c_str();
}

const char* getLevelText(int side)
{
	int tempLevel = (level + 1)*2 - 1;
	if (side == 1)
	{
		tempLevel++;
	}
	std::string s = std::to_string(tempLevel);
	level_text = "HOLE: " + s;
	return level_text.c_str();
}

Another smaller issue was I was always getting a ttf error because the check did not work correctly.
This I patched as follows:

bool init()
{
	if (SDL_Init(SDL_INIT_VIDEO) > 0)
		std::cout << "HEY.. SDL_Init HAS FAILED. SDL_ERROR: " << SDL_GetError() << std::endl;
	if (!(IMG_Init(IMG_INIT_PNG)))
		std::cout << "IMG_init has failed. Error: " << SDL_GetError() << std::endl;
	if (TTF_Init()==-1){
		std::cout << "TTF_init has failed. Error: "<< TTF_GetError() << std::endl;
  }

  std::cout<<"Opening audio now!"<<std::endl;
	Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048);
	return true;
}

Ideally however you could better return a std::string or a smart pointer instead.

Now everything works except the sounds are not playing. But I do see its a nice game. Well done in 2 days ;).

Screenshot 2021-08-17 at 20 45 30

Memory leaks

Memory leaks are still a massive issue , within 60 seconds this program leaked 10+ gb of memory , thank god for swap
leak
files.

ball power

mouse cant set ball power properly because of edge of screen maybe cursor needs to be set to false during shots ?

Add static workflow workflow?

Should I add a static build workflow for linux? This would make it so people aren’t forced to install sdl themselves

No such file SDL2/SDL_image.h

i installed both sdl1.2 and sdl2 and get errors on all lines involving sdl
fatal error: SDL2/SDL_image.h: No such file or directory

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.