Compare commits

..
16 Commits
Author SHA1 Message Date
Justin 639b43e5c7 docs: add introductory narrative for Shotgun Pete. 2025-12-29 18:47:21 -06:00
Justin c6d22f9d8f Turned off the gameloop. 2025-09-24 17:13:20 -05:00
Justin 6a69ea5685 added a exit 2025-05-15 20:35:13 -05:00
Justin 3aee2fa468 fixed typo issues and added some headers 2025-05-15 19:42:55 -05:00
Justin 0bfecbfb66 working on the player 2025-05-13 23:17:24 -05:00
Justin 7beb263dfc Starting the player 2025-05-11 21:48:04 -05:00
Justin 420998231b init 2025-05-11 21:06:17 -05:00
Justin fc4a95db3d Fixed the time of the typing. 2025-05-11 20:47:56 -05:00
Justin 331a0812bc Added more to the ignored file 2025-05-11 18:21:45 -05:00
Justin 888c0744d9 init 2025-05-11 18:16:46 -05:00
Justin 72a07395c7 Added the game loop the game. 2025-05-11 18:06:28 -05:00
Justin ee934b2d26 Added game.d to the list that was not needed. 2025-05-11 18:05:29 -05:00
Justin b57c137daf init the game loop 2025-05-11 16:06:26 -05:00
Justin 5e8a530dba Changed the color 2025-05-11 14:59:55 -05:00
Justin 53d83a16fb Added all of the intro 2025-05-11 14:59:08 -05:00
Justin d0fad7966a Change the type time to 250 2025-05-11 12:55:52 -05:00
23 changed files with 99 additions and 6 deletions

No files matched your search

+8
View File
@@ -6,3 +6,11 @@ banner.txt
print.d
intro.d
sleep.d
game.d
chest.d
door.d
inventory.d
player.d
room.d
wall.d
item.d
View File
Whitespace-only changes.
File renamed without changes.
View File
Whitespace-only changes.
+27
View File
@@ -0,0 +1,27 @@
#include "include/game.h"
void Game::gameloop(){
//This is the main game loop.
const int target_fps = 15;
const std::chrono::duration<double> target_frame_duration = chrono::duration<double>(1.0 / target_fps);
auto previous_time = std::chrono::steady_clock::now();
while(true){
auto current_time = std::chrono::steady_clock::now();
chrono::duration<double> elapsed_time = current_time - previous_time;
// Game logic and rendering here
system("clear");
cout << "Frame time: " << elapsed_time.count() << " seconds" << endl;
if (elapsed_time < target_frame_duration) {
chrono::duration<double> sleep_time = target_frame_duration - elapsed_time;
this_thread::sleep_for(sleep_time);
}
previous_time = chrono::steady_clock::now();
exit(1);
}
}
View File
Whitespace-only changes.
View File
Whitespace-only changes.
+12
View File
@@ -0,0 +1,12 @@
#include <iostream>
#include <chrono>
#include <thread>
#include <cstdlib>
using namespace std;
class Game{
public:
void gameloop();
};
+11
View File
@@ -0,0 +1,11 @@
class Inventory{
public:
Inventory(){
};
};
+6
View File
@@ -0,0 +1,6 @@
class Item{
};
+1
View File
@@ -2,4 +2,5 @@
#include "intro.h"
#include "title.h"
#include <cstdlib>
#include "game.h"
using namespace std;
+14
View File
@@ -0,0 +1,14 @@
#include "inventory.h"
#include "item.h"
class Player{
public:
void move();
void add_inventory(Item);
bool check_inventory(Item);
bool remove_inventory(Item);
private:
Inventory inventory;
};
View File
Whitespace-only changes.
View File
Whitespace-only changes.
+10 -1
View File
@@ -2,5 +2,14 @@
void Intro::mainIntro(){
Print::blank_line();
Print::type("The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against steel shutters.");
Print::type("The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against ");
Print::type("steel shutters.");
Print::type("Pete used to sell shotguns, slugs, and survival tips to deer hunters and doomsday preppers out of his");
Print::type("rundown gun store on the edge of town. Folks called him Shotgun Pete. They laughed at his bunker in the");
Print::type("basement and his endless stockpile of beans and buckshot.");
Print::type("They’re not laughing now.");
Print::type("It’s been 47 days since the dead started walking. The city’s overrun. The power’s gone. The roads are broken");
Print::type("and the rules are worse.");
Print::type("But Pete? Pete’s still here. Armed to the teeth. Ready to take back what’s his, one shell at a time.");
Print::type("Welcome to Shotgun Pete. Lock and load.");
}
View File
Whitespace-only changes.
View File
Whitespace-only changes.
+3 -3
View File
@@ -2,10 +2,10 @@
int main (){
system("clear");
//Title title;
Title::mainTitle();
//Intro intro;
Intro::mainIntro();
//cin >> ;
//Game game;
//game.gameloop();
cin.get();
return 0;
}
+4
View File
@@ -0,0 +1,4 @@
#include "include/player.h"
+1 -1
View File
@@ -13,7 +13,7 @@ void Print::type(string text){
char* charArray = new char[a+1];
strcpy(charArray, text.c_str());
int i = 0;
int time = 300;
int time = 150;
while(i < a+1){
std::this_thread::sleep_for(std::chrono::milliseconds(time));
View File
Whitespace-only changes.
+2 -1
View File
@@ -4,7 +4,8 @@
void Title::mainTitle(){
int s = 900;
Print::println("███████╗██╗ ██╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗████████╗███████╗");
Print::println("");
Print::println("\033[31m███████╗██╗ ██╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗████████╗███████╗");
Sleep::delay(s);
Print::println("██╔════╝██║ ██║██╔═══██╗╚══██╔══╝██╔════╝ ██║ ██║████╗ ██║ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝");
Sleep::delay(s);
View File
Whitespace-only changes.