OTTHUNDERDOME I : THE THUNDERVAULT - HOME OF THE GOODS
Would you like to react to this message? Create an account in a few clicks or log in to continue.

oaky's text-based adventure game - made in glorious c

4 posters

Page 1 of 2 1, 2  Next

Go down

oaky's text-based adventure game - made in glorious c Empty oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 7:45 pm

windows-only version
Code:

/*
 ============================================================================
 Name        : text adventure
 Author      : oaky
 Version     : 1.00
 Copyright   : fuknerds license
 Description : sample adventure that can be made with this quality engine
 ============================================================================
 */
#include <stdio.h>
#include <stdlib.h>
#include <windows.h> // for windoze support

int health = 100;
int armor = 0;
 
void main() {
 startGame(); // Begin game, and continue until the game is beaten.
 return 0;
}

void startGame() {
 char input; // Only one character in size.
 printf("                                Text Adventure Game! \n");
 printf("You are in a dark room. Your hands are binded. What do you do? \n");
 printf("(S)ay 'help!' | (B)reak your bonds | (C)ommit Adultery :>");
 scanf("%c",&input); // Pointer for input (determined to be a char by %c)
 // Input check
 if(input == 's') {
 write("You shout for help, but nobody hears you. \n");
 write("You slowly starve to death. \n");
 update(0,0);
 blinkGameOver();
 return;
 }
 
if(input == 'b') {
 write("As hard as you can, you struggle to break free from the bonds. \n");
 write("You slowly starve to death. \n");
 update(0,0);
 blinkGameOver();
 return;
 }
 
if(input == 'c') {
 write("Adultery is sinful. \n");
 // Zap!
 write("You were struck down by the lord. \n");
 update(0,0);
 blinkGameOver();
 return;
 }
}

void write(char input[]) { // The glorious write-it-out method.
 int i; // Declare counter.
 for(i=0;i<strlen(input);i++) {
 printf("%c",input[i]);
 if(i & 1) { // Every other character.
 if(input[i] != " ") { // If the character is not a space.
 Beep(400,10);
 }
 }
 Sleep(50);
 }
}

void update(int healthAmt, int armorAmt) {
 Sleep(1000);
 health = healthAmt;
 armor = armorAmt; // Set values equal to what is given.
 if(health == 0) { // If the game is over, play this noise and print the text as the 'death beep' plays.
 Beep(2500,500); // Heart monitor sound.
 Beep(0,500);
 Beep(2500,600);
 Beep(0,700);
 Beep(2500,700);
 Beep(0,900);
 printf("\n                                   HEALTH: %d \n",health);
 Beep(2500,3000);
 }
 else { // Otherwise, just show the health (and armor).
 Beep(200,1000);
 printf("\n                                   HEALTH: %d \n",health);
 }
 if(armor > 0) {
 printf("ARMOR: %d \n",armor);
 }
}

void clearScreen() {
 printf("\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n"); // Clear the screen.
 // Note: clear-screen speed?
}

void blinkGameOver() {
 int i; // Declare counter.
 int i2; // Other counter.
 printf("                                   "); // Prints without tapping.
    write("GAME OVER \n");
 Sleep(1000);
 for(i=0; i<1000; i++) {
 for(i2=0; i2<10; i2++) {
 printf("                                   GAME OVER \n");
 clearScreen();
 }
 }
}
unix/os x version
Code:

/*
 ============================================================================
 Name        : text adventure [posix]
 Author      : oaky
 Version    : 1.00
 Copyright  : fuknerds license
 Description : sample adventure that can be made with this quality engine with improved unix functionality
 ============================================================================
 */
#include <stdio.h>
#include <unistd.h>
#include <curses.h> // needed for that glorious beep
//uncomment the below line if the shit ain't working
//#include <stdlib.h>

int health = 100;
int armor = 0;
 
void main() {
 startGame(); // Begin game!
 return 0; // Shit closed successfully
}

void startGame() {
 char input; // Only one character in size.
 printf("                                Text Adventure Game! \n");
 printf("You are in a dark room. Your hands are binded. What do you do? \n");
 printf("(S)ay 'help!' | (B)reak your bonds | (C)ommit Adultery :>");
 scanf("%c",&input); // Pointer for input (determined to be a char by %c)
 // Input check
 if(input == 's') {
 write("You shout for help, but nobody hears you. \n");
 write("You slowly starve to death. \n");
 update(0,0);
 blinkGameOver();
 return;
 }
 
if(input == 'b') {
 write("As hard as you can, you struggle to break free from the bonds. \n");
 write("You slowly starve to death. \n");
 update(0,0);
 blinkGameOver();
 return;
 }
 
if(input == 'c') {
 write("Adultery is sinful. \n");
 // Zap!
 write("You were struck down by the lord. \n");
 update(0,0);
 blinkGameOver();
 return;
 }
}

void write(char input[]) { // The glorious write-it-out method.
 int i; // Declare counter.
 for(i=0;i<strlen(input);i++) {
 printf("%c",input[i]);
 if(i & 1) { // Every other character.
 if(input[i] != " ") { // If the character is not a space.
 beep();
 }
 }
 usleep(50);
 }
}

void update(int healthAmt, int armorAmt) {
 usleep(1000);
 health = healthAmt;
 armor = armorAmt; // Set values equal to what is given.
 if(health == 0) { // If the game is over, play this noise and print the text as the 'death beep' plays.
 beep(); // Heart monitor sound.
 usleep(500);
 beep();
 usleep(500);
 beep();
 usleep(500);
 printf("\n                                  HEALTH: %d \n",health);
 beep();
 flash();
 }
 else { // Otherwise, just show the health (and armor).
 beep();
 printf("\n                                  HEALTH: %d \n",health);
 }
 if(armor > 0) {
 printf("ARMOR: %d \n",armor);
 }
}

void clearScreen() {
 printf("\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n"); // Clear the screen.
 // Note: clear-screen speed?
}

void blinkGameOver() {
 int i; // Declare counter.
 int i2; // Other counter.
 printf("                                  "); // Prints without tapping.
    write("GAME OVER \n");
 usleep(1000);
 for(i=0; i<1000; i++) {
 for(i2=0; i2<10; i2++) {
 printf("                                  GAME OVER \n");
 clearScreen();
 }
 }
}


Last edited by seth on Sun Dec 29, 2013 11:38 am; edited 1 time in total
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 7:50 pm

this would actually run on liniks without any libraries other than stdlib and stdio im pretty sure you can replace 'Sleep' with nanosleep or whatever it's called
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by Guest Wed Nov 27, 2013 10:44 pm

what do i save this as to run it
.exe? .bin? im retarded when it comes to this shit


Last edited by spinnythings on Wed Nov 27, 2013 10:45 pm; edited 2 times in total

Guest
Guest


Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:45 pm

spinnythings wrote:what do i save this as to run it
.exe? .bin?
lol it's in C you need to compile it and shit
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:45 pm

gonna see if i can compile this on linux for shits and giggles
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by Guest Wed Nov 27, 2013 10:45 pm

amsk8hurr wrote:
spinnythings wrote:what do i save this as to run it
.exe? .bin?
lol it's in C you need to compile it and shit
lol gay

Guest
Guest


Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by Guest Wed Nov 27, 2013 10:46 pm

amsk8hurr wrote:gonna see if i can compile this on linux for shits and giggles
take screenshots

Guest
Guest


Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:48 pm

spinnythings wrote:
amsk8hurr wrote:gonna see if i can compile this on linux for shits and giggles
take screenshots
i can just cut and paste

gcc is proudly command-line
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 10:51 pm

unless your linux has windows.h i dont think it'll work haha
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 10:51 pm

here hold on i'll try converting it to linuks
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:52 pm

eat my dick fag stop ruining my fun
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:52 pm

compiling anyways

whatever gay facist compiler you use is inferior to gcc btw
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 10:53 pm

replace #include with change 'sleep' to lowercase and divide by 1000 since its in seconds
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 10:53 pm

amsk8hurr wrote:compiling anyways

whatever gay facist compiler you use is inferior to gcc btw
gcc ported to windoze called 'mingw'
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:55 pm

SETH TRAIN wrote:
amsk8hurr wrote:compiling anyways

whatever gay facist compiler you use is inferior to gcc btw
gcc ported to windoze called 'mingw'
"minimalist gnu for windows"

wtf why not just use gnuwin32
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:55 pm

and im almost certain that gcc has an official windongs port
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 10:56 pm

amsk8hurr wrote:
SETH TRAIN wrote:
amsk8hurr wrote:compiling anyways

whatever gay facist compiler you use is inferior to gcc btw
gcc ported to windoze called 'mingw'
"minimalist gnu for windows"

wtf why not just use gnuwin32
it doesnt matter none of them will be cross-platform they all need windows.h to use the win32 libraries instead of posix shit
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by amsk8hurr Wed Nov 27, 2013 10:57 pm

if windows followed posix guidelines maybe it wouldnt be so fuckin shitty
amsk8hurr
amsk8hurr
shameless shitposter

Posts : 671
money : 721
bitches : 1
Join date : 2013-11-24
Age : 27

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 11:08 pm

official demo

LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 11:09 pm

oops i should have wrote 'your hands are bound' whatever
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 11:23 pm

spinnythings is speechless as he imagines the power of my game engine running on pure glorious c
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Wed Nov 27, 2013 11:24 pm

every le video gayme dev in the world dies at the sound of "HEALTH: 0"
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Sun Dec 29, 2013 11:38 am

mfw stupid ammers won't even compile my posix-compliant source code
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by am Sun Dec 29, 2013 12:28 pm

dont compile itsa a virus
am
am

Posts : 1028
money : 1109
bitches : 12
Join date : 2013-11-05
Age : 27
Humor : I don't like amsk8r that much; his autism usually gets the better of him.

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by LEADER OF THE FREE WORLD Sun Dec 29, 2013 12:54 pm

please compile so i know if it works!
LEADER OF THE FREE WORLD
LEADER OF THE FREE WORLD
UNSTOPPABLE

Posts : 21233
money : 2147483634
bitches : -828
Join date : 2013-02-25
Age : 14
Location : worlds most dangerous hacker
Humor : bench 420 squat 420 deadlift 420

Back to top Go down

oaky's text-based adventure game - made in glorious c Empty Re: oaky's text-based adventure game - made in glorious c

Post by Sponsored content


Sponsored content


Back to top Go down

Page 1 of 2 1, 2  Next

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum