Skip to content

Instantly share code, notes, and snippets.

View JohnBobSmith's full-sized avatar

David Bogner JohnBobSmith

  • Alberta, Canada
View GitHub Profile
Sun Feb 11 jbs@dmb-gaming-laptop -> make clean
rm -f *.o debugging_tests
Sun Feb 11 jbs@dmb-gaming-laptop -> ls
main.cpp Makefile
Sun Feb 11 jbs@dmb-gaming-laptop -> make
g++ -c -o main.o main.cpp
g++ -o debugging_tests main.o -g -Wall
Sun Feb 11 jbs@dmb-gaming-laptop -> gdb debugging_tests
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
//Line 75-78 in main.cpp
//LMG
sf::Time lmgRof = sf::milliseconds(100);
sf::Time lmgReloadTime = sf::milliseconds(750);
Weapon lmg("../textures/weapons/lmg.png", 20, 150, 30, lmgRof, lmgReloadTime, "lmg");
Tue Sep 26 jbs@dmb-gaming-laptop -> make clean
rm -f *.o johntileengine
Tue Sep 26 jbs@dmb-gaming-laptop -> make
g++ -Wall -g -c -o AnimatedProps.o AnimatedProps.cpp
g++ -Wall -g -c -o Bullet.o Bullet.cpp
g++ -Wall -g -c -o Camera.o Camera.cpp
g++ -Wall -g -c -o Collision.o Collision.cpp
g++ -Wall -g -c -o Config.o Config.cpp
g++ -Wall -g -c -o Font.o Font.cpp
g++ -Wall -g -c -o main.o main.cpp
#include "LinkedList.h"
#include <iostream>
#include <cstdlib>
LinkedList::LinkedList()
{
head = NULL;
current = NULL;
temporary = NULL;
}
@JohnBobSmith
JohnBobSmith / GameEngine.cpp
Created January 3, 2015 23:11
A new game engine system, in hopes of making game states easier.
#include "GameEngine.h"
#include "GameState_Playing.h"
bool GameEngine::init_engine()
{
//initialize all SDL related stuff.
if(SDL_Init(SDL_INIT_EVERYTHING) < 0){
std::cout << "Failed to init video... SDL Error: " << SDL_GetError() << std::endl;
return false;
}
@JohnBobSmith
JohnBobSmith / GameStateHandler.h
Created January 2, 2015 19:15
Game state classes and main class for pong, trying to get a main menu working...
//note that GameStateHandler.cpp is completely blank.
#ifndef GAMESTATEHANDLER_H
#define GAMESTATEHANDLER_H
class GameStateHandler
{
public:
enum GAME_STATES
{
@JohnBobSmith
JohnBobSmith / SomeRandomClass.cpp
Created December 31, 2014 23:06
Test classes...
#include "TheAwesomeClass.h"
#include "SomeRandomClass.h"
#include <iostream>
void SomeRandomClass::add_variables(int variableToAdd)
{
TheAwesomeClass theawesomeclass;
variableToAdd += theawesomeclass.awesomeVariable;
@JohnBobSmith
JohnBobSmith / AI.cpp
Last active August 29, 2015 14:12
Pong AI and Ball classes
#include "main.h"
#include "AI.h"
#include "Ball.h"
void AI::init_ai()
{
Main main;
//initialize the AI, not much here becaue the AI is very basic.
aiPaddle.h = 40;
aiPaddle.w = 10;