Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
/* Jaros der Naturdruide Version: 1.0 Autor: Simon Klausner */ #include "Jaros.hpp" #include "Tutorial.hpp" #include "Jaros der Naturdruide.hpp" #include <fstream> //Hauptprogramm //Erstellt den Druiden und erzählt ein bischen die Geschichte //Führt anschließend weiter zu der ersten Hauptquest //Erstellt weiters ein kleines Startmenü CJaros *pJaros = NULL; CJaros Spielstand; ////////////////////////////////////////////////////////////////////////// int main() { cout << " rotfl.." << endl; sndPlaySound("C:\\Spiele\\Sounds\\Opening.wav", SND_ASYNC); //Variablen int i_Menueauswahl = 0; //Zufallsgenerator initialisieren srand (timeGetTime()); //Startmenue cout << "----------------------------------------" << endl; cout << "Das Abenteuer von Jaros dem Naturdruiden" << endl; cout << "----------------------------------------" << endl; cout << "++++++++++++++++++++++++++++++++++++++++" << endl; do { cout << "----Startmenue----" << endl; cout << "1. Spiel starten" << endl; cout << "2. Lies Mich" << endl; cout << "3. Laden" << endl; cout << "4. Beenden" << endl; cin >> i_Menueauswahl; //Je nach Auswahl weiterfahren switch (i_Menueauswahl) { case(1): { delete pJaros; pJaros = NULL; pJaros = new CJaros(); cout << "Spiel wird gestartet..." << endl; pJaros->ZeigeDaten(); TutorialText(); } break; case (2): { cout << "Lies Mich Datei wird aufgerufen..." << endl; } break; case (3): { cout << "Spielstand wird gesucht..." << endl; Laden(); } break; case (4): { cout << "Spiel wird beendet..." << endl; } break; default: { cout << "Fehler in der Eingabe. Bitte erneut eingeben." << endl; } } } while (i_Menueauswahl != 4); delete pJaros; pJaros = NULL; return 0; } ////////////////////////////////////////////////////////////////////////// //Speicher void Speichern() { Spielstand = *pJaros; cout << "Spielstand wird gespeichert." << endl; ofstream Output ("Spielstand.sps" , ios::binary); Output.write((char*) &Spielstand, sizeof (Spielstand)); Output.close(); } void Laden() { //Variablen bool b_TuTCompleted = false; delete pJaros; pJaros = NULL; pJaros = new CJaros(); cout << "Spielstand wird geladen." << endl; ifstream Input ("Spielstand.sps", ios::binary); Input.read((char*) &Spielstand, sizeof (Spielstand)); *pJaros = Spielstand; Input.close(); pJaros->GetQuestList(&b_TuTCompleted); //Tutorial erledigt und laden if(b_TuTCompleted == true) Kalksteingebirge(); } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
/* Tutorial.cpp Version:1.0 Autor:Simon Klausner*/ //Das Tutorial erklärt das Spiel //Ein Testkampf den man nicht verlieren kann //Handeln wird gezeigt #include "Tutorial.hpp" #include "Jaros.hpp" #include "Items.hpp" #include "Kampfsystem.hpp" #include "Gegner.hpp" #include "Jaros der Naturdruide.hpp" extern CJaros *pJaros; void TutorialText() { //... } ////////////////////////////////////////////////////////////////////////// //Kalksteingebirge void JittsundRephs1() { //.. pJaros->TuTCompleted(); cout << "Ihr koennt euren Spielstand nun speichern: " << endl; cout << "(J)a - (N)ein" << endl; cin >> ch_Speichern; if(ch_Speichern == 'j' || ch_Speichern == 'J') { Speichern(); } //Kalksteingebirgshoehle laden Kalksteingebirge(); } void Kalksteingebirge() { //... } |
C-/C++-Quelltext |
|
1 |
*pJaros = Spielstand; |
C-/C++-Quelltext |
|
1 |
pJaros = &Spielstand; |
Anonymous
unregistriert
C-/C++-Quelltext |
|
1 2 3 |
#include "Jaros der Naturdruide.hpp" extern CJaros *pJaros; |
Anonymous
unregistriert
Werbeanzeige