Latest SDL2 Activity
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, …
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 …

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…
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…
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…

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…

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 gameThe game is built using:
- C++ and SDL (for rendering, window …