• What are you working on? V10
    2,002 replies, posted
My Text Adventure so far: [code] #include <stdio.h> #include <tchar.h> #include <cstdio> #include <cstdlib> #include <iostream> #include <cmath> #include <string> using namespace std; string name; string reply; char strnew[255]; // Death func int death(); // The sections int s1(); int s1torch(); int s1zombie(); int s1pit(); int s1as(); int s2(); int s2back(); int s2wall(); int s2eatbrick(); int s2pushbrick(); int s2pullbrick(); int s3(); // Deciders int retID(string caseR); int retID2(string caseR); int retID3(string caseR); int retID4(string caseR); int retID5(string caseR); int retID(string caseR) { if (caseR == "NORTH" || caseR == "north" || caseR == "North") { return 1;} if (caseR == "SOUTH" || caseR == "south" || caseR == "South") { return 2; } if (caseR == "WEST" || caseR == "west" || caseR == "WEST") { return 3; } } int retID2(string caseR) { if (caseR == "TORCH" || caseR == "Torch" || caseR == "torch") { return 1;} if (caseR == "SOUTH" || caseR == "South" || caseR == "south") { return 2; } if (caseR == "WEST" || caseR == "West" || caseR == "west") { return 3; } if (caseR == "NORTH" || caseR == "North" || caseR == "north") { return 4; } } int retID3(string caseR) { if (caseR == "SOUTH" || caseR == "South" || caseR == "south") { return 1; } if (caseR == "WEST" || caseR == "West" || caseR == "west") { return 2; } } int retID4(string caseR) { if (caseR == "SOUTH" || caseR == "South" || caseR == "south") { return 1; } if (caseR == "WEST" || caseR == "West" || caseR == "west") { return 2; } if (caseR == "WALL" || caseR == "Wall" || caseR == "wall") { return 3; } } int retID5(string caseR) { if (caseR == "VERB" || caseR == "Verb" || caseR == "verb") { return 1; } if (caseR == "EAT" || caseR == "Eat" || caseR == "eat" ) { return 2; } if (caseR == "PUSH" || caseR == "Push" || caseR == "push") { return 3; } if (caseR == "PULL" || caseR == "Pull" || caseR == "pull") { return 4; } } // greeting int main() { cout << "Greetings! Welcome to the Turnip Role Playing Game! \n I am the Dungeon Master! Let's begin! \n What is your first name? \n"; cin >> name; system("cls"); cout << "Okay, " << name << ", let's get down to buisness! \n PRESS ENTER TO CONTINUE"; system("pause >Nul"); s1(); } // First part of the adventure int s1() { system("cls"); cout << "You awake in a dark area. The drip of water fills echos throughout the dark corridor. Your choices to move are North, South, or West.\n <ANSWER IN ALL CAPS, ONE WORD> \n"; cin >> reply; switch(retID(reply)) { case 1: s1torch(); break; case 2: s1zombie(); break; case 3: s1pit(); break; default: cout << "You can't do that!"; system("pause >Nul"); s1(); } return 0; } // TORCH GET :D int s1torch() { system("cls"); cout << "You stumble northward, only to trip on a long object. Upon further investigation, you find out that it is a TORCH. \n You can go NORTH, WEST, SOUTH, or TORCH.\n"; cin >> reply; switch(retID2(reply)) { case 1: s2(); break; case 2: s1(); break; case 3: s1as(); break; default: cout << "You cannot do that!"; system("pause >Nul"); s1torch(); } return 0; } int s2() { system("cls"); cout << "You grab the torch and it magically lights up. You can see the stone walls and floors, signifying you're in a dungeon. \n Your options are WEST, and SOUTH. \n"; cin >> reply; switch(retID3(reply)) { case 1: s2back(); break; case 2: s1pit(); break; default: cout << "You cannot do that!"; } return 0; } int s2back() { cout << "You return back to the room you originally started in. You see a strange indentation in the EAST WALL. \n Your options are SOUTH, WEST, or WALL. \n"; cin >> reply; switch(retID4(reply)) { case 1: s1zombie(); break; case 2: s1pit(); break; case 3: s2wall(); break; default: cout << "You cannot do that!"; } return 0; } int s2wall() { system("cls"); cout << "You investigate the strange indentation in the wall. To the left lies a loose BRICK. The BRICK is jutting out of the wall about two inches, enough to PULL or PUSH it. What do you do with BRICK? \n (Use just a verb: IE verb) \n"; cin >> reply; switch(retID5(reply)) { // Smart-Aleck response case 1: system("cls"); cout << "Silly " << name << "! That was an example. Now go back there and do it right!"; system("pause >Nul"); s2wall(); break; case 2: s2eatbrick(); break; case 3: s2pushbrick(); break; case 4: s2pullbrick(); break; default: system("cls"); cout << "You can't do that!"; system("pause >Nul"); s2wall(); } return 0; } int s2pushbrick() { system("cls"); cout << "You push the brick in, and the room shakes. The indentation in the wall begins to lean towards you. \n You jump out of the way just in time for the bricks to crumble and fall onto the spot where you were just standing. \n You quint as the light from the outside filters through the dust. \n Crawling outside, you see a road, which leads WEST, EAST, or SOUTH. To the EAST lies a town, the WEST a forest, and the SOUTH a gate."; cin >> reply; system("cls"); cout << "Thank you for playing this far through the demo, " << name << "! Please give your thoughts, comments, and concerns to Connor West at the e-mail of MTurnipson@gmail.com!"; system("pause >Nul"); } // Death int s1as() { cout << "You head west, leaving the torch behind. You begin to explore the area you are in. Suddenly you hear the sound of a sword unsheathing, and feel someone - or something's - presence. A katana rips through your abdomen, leaving our halved on the floor."; system("pause >Nul"); death(); return 0; } int s1zombie() { system("cls"); cout << "You cautiously walk southbound. You hear a strange moaning from behind you. Before you have a chance to react, a ZOMBIE jumps on top of you. You can feel the flesh being ripped from your bones as you draw your last breath..."; system("pause >Nul"); death(); return 0; } int s1pit() { system("cls"); cout << "You walk towards the West. You begin to hear the crunch of leaves. \n Just as you begin to wonder why you hear the crunch of leaves in a dark area, you begin to fall. And fall... And fall. \n Your screams of both terror and joy (You did enjoy Ye Olde Rollercoasters as a child) are quashed by spikes at the bottom of the pit."; system("pause >Nul"); death(); return 0; } int s2eatbrick() { system("cls"); cout << "You eat the brick. It tastes brick-like. You realize you made a stupid mistake (which is true) and fall on the floor dead. Wow, you're an idiot."; system("pause >Nul"); death(); return 0; } int s2pullbrick() { system("cls"); cout << "You pull on the brick with all of your might. Since you skipped out on Ye Olde Architecture Class in school, you didn't realize it was a load bearing brick. \n The entire wall falls on you, instantly killing you"; system ("pause >Nul"); death(); return 0; } // Death Func int death() { system("cls"); cout << "Congratulations! You have died. Press enter to return to the beginning!"; system("pause >Nul"); system("cls"); s1(); return 0; } /* CREDITS: Lead programmer: ME Troubleshooter: Firehawk Beta Testers: ME , Michael "Meow" Gervais, Johnathan "Joshua Florist" Carpenter */ [/code]
I recently made like my second or third program designed to actually do something. It just generates a wall of text which I then copy into a PM to help people make their avatars transparent. [code][noparse]#include <iostream> using namespace std; string oldfile, newfile, a, b, c, d, e, f, g; int main() { a = "n"; b = "n"; c = "n"; d = "n"; e = "n"; f = "n"; g = "n"; cout << "What is the \033[22;31mORIGINAL\033[22;30m avatar's URL?\n"; cin >> oldfile; cout << "Good, now what's the \033[22;31mNEW\033[22;30m image's URL?\n"; cin >> newfile; cout << "Did you add transparency? \033[32m[Y/n]\033[30m\n"; cin >> a; cout << "Did you crop the image to reduce blank space? \033[32m[Y/n]\033[30m\n"; cin >> b; cout << "Did you resize the image better from the original? \033[32m[Y/n]\033[30m\n"; cin >> c; cout << "Did you save as PNG? \033[32m[Y/n]\033[30m\n"; cin >> d; cout << "Did you manually remove ugly compression? \033[32m[Y/n]\033[30m\n"; cin >> e; cout << "Did you optimize it? \033[32m[Y/n]\033[30m\n"; cin >> f; cout << "Did the user provide a source image? \033[32m[Y/n]\033[30m\n"; cin >> g; cout << "\n\n\n\n\n\n\n\n\n\n\n\n\n"; if ( g == "y" or "Y" ) { cout << "Thank you for providing the source image. Here is the result:\n\n[img]"; } else { cout << "Hello! I did some work on your avatar for you.\n\n[img]"; } cout << newfile; cout << "[/img]\n\n[B]Changes:[/B][list]\n"; if ( a == "y" or "Y" ) { cout << "[*][B]Added transparency-[/B] [I]see below[/I]\n"; } if ( b == "y" or "Y" ) { cout << "[*][B]Cropped better-[/B] Useless, wasted blank space removed\n"; } if ( c == "y" or "Y" ) { cout << "[*][B]Resized better-[/B] Resized better from the original to maximize usage of space given\n"; } if ( d == "y" or "Y" ) { cout << "[*][B]Saved as PNG-[/B] PNG generally gets better compression ratios and is lossless, but supports truecolor, unlike GIF which is restricted to a 256-color palette.\n"; } if ( e == "y" or "Y" ) { cout << "[*][B]Manually removed JPG compression-[/B] The JPG format can be useful, but it reduces the actual image quality of your images. I actually went in and manually fixed this.\n"; } if ( f == "y" or "Y" ) { cout << "[*][B]Optimized-[/B] filesize reduced losslessly\n"; } cout << "[/list]\n\n"; if ( a == "y" or "Y" ) { cout << "[B]What's transparency?[/B] What better way to answer than by demonstrating!\n\n[img]http://img682.imageshack.us/img682/1981/transparencyinavatars.png[/img]\n\nOn the left is an avatar without transparency. On the right is an avatar [I]with[/I] transparency. See the difference?\n\nHere is a comparison of my version and your version of your avatar. (Mine is on the left).\n\n[img]"; cout << newfile; cout << "[/img][img]"; cout << oldfile; cout << "[/img]\n\nAnd here they are on a blue background. See the difference?\n\n[quote][img]"; cout << newfile; cout << "[/img][img]"; cout << oldfile; cout << "[/img][/quote]\n\n"; } cout << "Enjoy."; return 0; } [/noparse][/code] [B]NOTE:[/B] I'm using Linux, so the "\033[32m" and all that is used to color terminal output. It'll look wrong in Windows.
Why did you enclose that all with [noparse]? Ninja edit :ninja:
[QUOTE=andersonmat;22260166]Particle Rendering :haw: [img]http://anyhub.net/file/1particlerendering.png[/img][/QUOTE] That looks extremely similar to Arcadium :v:
ARCADIUM IS THE NEW MANDELBROT!!! SOUND THE KLAXON!! RING THE BELL!! BLINK THE BLINKENLIGHTS!! (That's not aimed at you as an attack Joshyy)
[QUOTE=TheBoff;22264141]ARCADIUM IS THE NEW MANDELBROT!!! SOUND THE KLAXON!! RING THE BELL!! BLINK THE BLINKENLIGHTS!! (That's not aimed at you as an attack Joshyy)[/QUOTE] I know, I find it funny that I started a new fad :3:
Testing out the efficiency of my grapher: [img]http://img31.imageshack.us/img31/8660/arcf.png[/img] [code] plot2 (x-0.2)^2+(y-0.5)^2=0.5^2 plot2 (x+1)^2+(y+2)^2=0.5^2 plot2 (x+2)^2+(y+0.5)^2=0.5^2 plot2 (x^2+y^2=0.5^2 plot2 (x-3)^2+(y-2)^2=0.5^2 plot2 (x-2)^2+(y-2.5)^2=0.5^2 plot2 (x-2.5)^2+(y-4)^2=0.5^2 [/code]
[QUOTE=Joshyy;22264280]I know, I find it funny that I started a new fad :3:[/QUOTE] Wish I could start a new fad. I guess build systems are just boring for some people :v:
[QUOTE=nullsquared;22264723]Testing out the efficiency of my grapher: [img]http://img31.imageshack.us/img31/8660/arcf.png[/img] [code] plot2 (x-0.2)^2+(y-0.5)^2=0.5^2 plot2 (x+1)^2+(y+2)^2=0.5^2 plot2 (x+2)^2+(y+0.5)^2=0.5^2 plot2 (x^2+y^2=0.5^2 plot2 (x-3)^2+(y-2)^2=0.5^2 plot2 (x-2)^2+(y-2.5)^2=0.5^2 plot2 (x-2.5)^2+(y-4)^2=0.5^2 [/code][/QUOTE] Even Null is getting in on it! :v:
[QUOTE=Chandler;22264748]Wish I could start a new fad. I guess build systems are just boring for some people :v:[/QUOTE] [i]still[/i] working on that? :v:
A simple server that allows a client to connect to your computer and talk with your steam friends. Next step is a Android client, and a Windows Mobile 7 if they let me use Sockets someday. [img]http://uppix.net/e/4/4/bdf8639e673d52ebed609a9ad557b.png[/img]
Note: you have a typo :v:
[QUOTE=efeX;22265432][i]still[/i] working on that? :v:[/QUOTE] YUP. The reason I'm making it is so I can have a sane build system for my other projects. I'm nearly done with this revision too :D
[QUOTE=nullsquared;22265581]Note: you have a typo :v:[/QUOTE] Oops, my bad. Thanks . [img]http://uppix.net/3/8/4/5b1119263c93f7b3ac84d49df4036.png[/img]
[QUOTE=OrYgin;22265514]A simple server that allows a client to connect to your computer and talk with your steam friends. Next step is a Android client, and a Windows Mobile 7 if they let me use Sockets someday. [img]http://uppix.net/e/4/4/bdf8639e673d52ebed609a9ad557b.png[/img][/QUOTE] Steam is getting hungry!
[QUOTE=OrYgin;22265514]A simple server that allows a client to connect to your computer and talk with your steam friends. Next step is a Android client, and a Windows Mobile 7 if they let me use Sockets someday. [img]http://uppix.net/e/4/4/bdf8639e673d52ebed609a9ad557b.png[/img][/QUOTE] do something more interesting, figure out the steam protocol and use that.
[QUOTE=OrYgin;22265514]A simple server that allows a client to connect to your computer and talk with your steam friends. Next step is a Android client, and a Windows Mobile 7 if they let me use Sockets someday. [img]http://uppix.net/e/4/4/bdf8639e673d52ebed609a9ad557b.png[/img][/QUOTE] Iphone/Ipod Touch app?
How is C not object oriented, when it contains structures, which seem like objects to me?
[QUOTE=nos217;22268405]How is C not object oriented, when it contains structures, which seem like objects to me?[/QUOTE] You really don't want to ask that. Before you know it, HubmaN will come in here and spew out ten paragraphs on the subject. But the most basic reason, that most introductory courses teach, is that C doesn't allow structs to contain functions (although even that is not entirely true -- you can store function pointers in structs). C also doesn't natively support inheritance or polymorphism. edit: also, C structs don't require you to initialize the data members, whereas C++ objects must have a constructor
[QUOTE=shill le 2nd;22268604]You really don't want to ask that. Before you know it, HubmaN will come in here and spew out ten paragraphs on the subject. But the most basic reason, that most introductory courses teach, is that C doesn't allow structs to contain functions (although even that is not entirely true -- you can store function pointers in structs). C also doesn't natively support inheritance or polymorphism. edit: also, C structs don't require you to initialize the data members, whereas C++ objects must have a constructor[/QUOTE] C doesn't have language support for many common object-oriented features, that doesn't mean you can't do OOP in C. Even HubmaN agreed to this (in before HubmaN dropping by and claiming he didn't, just because he's terrified of admitting he agreed several times on this point).
That's what I'm saying. The definition of whether a language is object-oriented is very loose. It's a can of worms you really don't want to open.
[QUOTE=shill le 2nd;22269088]It's a can of worms you really don't want to open.[/QUOTE] Why not? We did it before, we can do it again if anyone is up for a discussion. I really don't feel HubmaN's argument was very compelling, his only defense was "I don't like the C++ way of doing objects". Apparently a CLOS has to be feasible and practical in a programming language to assume that it's sufficiently object-oriented.
[QUOTE=Joshyy;22264085]That looks extremely similar to Arcadium :v:[/QUOTE] Yes, pretty much. I thought, "Oh what the fuck, let's make a game like that, only let's incorporate networking and online scoring before he does." :colbert:
Might as well post my remake pics here: [img_thumb]http://filesmelt.com/dl/remake1.png[/img_thumb] [img_thumb]http://filesmelt.com/dl/remake2.png[/img_thumb]
My eyes now hurt. Anti-alias that, and your proportions are a bit off.
It's called Arkadium - The Crappy Remake for a reason. :v:
[QUOTE=Chad Mobile;22270628]It's called Arkadium - The Crappy Remake for a reason. :v:[/QUOTE] That's what separates you. You don't strive for perfection. That's the one thing I see in all of your projects. :saddowns:
Why would I want to make an EXACT remake of his game? That would be pointless. It's like having one company make a model car and then another remake it exactly. What's the point? They'd be the same thing. :iiaca:
Anyone know how to convert a char to Irrlichts KeyCodes?
[QUOTE=Chad Mobile;22270766]Why would I want to make an EXACT remake of his game? That would be pointless. It's like having one company make a model car and then another remake it exactly. What's the point? They'd be the same thing. :iiaca:[/QUOTE] Nobody said it had to be exact, just actually good.
Sorry, you need to Log In to post a reply to this thread.