Advertisement

Latest SDL2 Activity

pbivens67
February 22, 2025 12:47 AM

here is more code

			sprites.push_back(Sprite(1050, 950));

			int dragSpriteIndex = -1;
//			Sprite sprites;
			int prevX=0, prevY=0;
			bool quit = false;
			int deltaX = 0, deltaY = 0;
			int hex_x = 0, hex_y = 0;

			while (quit == false) {
				SDL_BlitSurface(gHelloWorld, NULL, gScreenSurface, …
12,849 views
Advertisement
NubDevice
February 14, 2025 02:01 AM

Ignore those. That's not your speed and your hex grid is not flat top. They are pointed top.
Joe has given you a simplified approach. http://gamedev.net/forums/topic/717858-click-and-drag-sprite/5468521/?page=6

Those formulas are for a group of individuals of a different caliper. 
Hexagonal Grid …

610 views
pbivens67
January 09, 2025 03:35 AM
panzer blitz

I have got the sprite to drawn to the right of the original sprite, I want the sprite to be moved by clicking and dragging the sprite

					else if (event.type == SDL_MOUSEBUTTONDOWN||SDL_MOUSEMOTION) {
						if (event.button.button == SDL_BUTTON_LEFT) {
							int mouseX, mouseY;
							SDL_GetMouse…
1,153 views
Alberth
January 03, 2025 01:16 PM

pbivens67 said:
my only problem is how to implement the computer player

Make it play at a random valid position at first, and improve from there.

Optimal play (as in, aiming for the shortest way to winning) is a solved problem, but it's so good that you have no chance at all (especially if it plays fi…

2,376 views
pbivens67
December 28, 2024 09:08 PM

I am switching to an exercise in my book, I want to sort the batting  averages and names and print them to the screen

#include <iostream>
#include <string>

using namespace std;

class Average
{
private:
	string name[12];
	double avg[12];
public:
	void getData();
	void sortData(stri…
66,235 views
Nick72c
July 03, 2022 01:47 AM
Parallax Zoom!! Gone Green!!

With no-one coming forward to offer artistic support I pushed forward and reworked / improved to my limitations, all background graphics.

Then added the remaining lives indicator and improved AI attack patterns,

From very early on in the games development I wanted to use a restricted number of textur…

7,058 views
ZerohBeat
March 31, 2020 05:25 PM
Finally I made a game.

Hi, its Aleks. 

This is my post mortem of making my first game from start to finish and publishing the game.

Game Page: https://zerohbeat.itch.io/zerohbeat-adventure

My game is a very simple and very short Adventure / Visual Novel style game

The game is built using:

  • C++ and SDL (for rendering, window …
4,503 views
Advertisement
Advertisement
Advertisement