Zum Inhalt springen

Malarkey

Member
  • Gesamte Inhalte

    2661
  • Benutzer seit

  • Letzter Besuch

Beiträge erstellt von Malarkey

  1. Wie es mich ankotzt, wie die ganzen Nachrichtenseiten von den großen Parteien gekauft werden, um die Piraten in Grund und Boden zu treten. Auf Spiegel Online vergeht kein Tag ohne klar gerichtete, angreifende Kommentare und Artikel (gerne Schlagzeile), gegen die Piraten. Ich hoffe, das Volk (das hört sich irgendwie immernoch seltsam an) merkt dass das Alles nur bezahlter Unfug und Schwachsinn ist.

    Lest euch mal die Schlagzeilen und Unterkapitel der Anti-Piraten Artikel durch. Spiegel Online ist sonst politisch immer weitgehend neutral. Das JETZT jedoch ist fast schon Propaganda.

  2. Mal ne Frage:

    Habe eine Art 'Die Staemme' für Arme geschrieben. Man verfügt also über Holz, Stein, Eisen, Gold, Nahrung etc. und kann damit Gebäude bauen, die dann wiederrum mehr Holz etc bringen oder es erlauben, mit virtuellen anderen 'Königreichen' zu handeln und sie anzugreifen, sich mit ihnen zu verbünden etc. Doch irgendwie fehlt mir in dem Spiel noch der Motivationsfaktor. Irgendetwas, was man erreichen möchte. Das Spiel läuft nur über Konsole. Wenn ich im Sommer meinen DX11-fähigen Laptop bekomme, werd ich mich an eine 2D umsetzung machen, wo dann aber auch immer noch hübsche Bilder mit Text auf dem Monitor zu sehen sind.

    Mir fehlt irgendwie etwas persönliches an dem Spiel... So, dass es nicht nur Ressourcenverwaltung ist. Ich hatte schon an sowas wie Quests gedacht, weiß aber nicht ob das was wäre...

    Auf Wunsch kann ich die neuste Version hochladen, welche aber vom Spielprinzip genau die Gleiche ist, wie die, die ich ein paar Seiten zuvor gepostet habe. Sind halt noch ein paar Features dazugekommen.

    Zudem hänge ich daran, einen guten und harmonischen Algorythmus für die wirtschaftliche Entwicklung der KI zu entwerfen. Die Gegner verfügen über die selben Ressorucen wie der Spieler. Doch wie binde ich ein möglichst reales Verhalten ein? Bisher gibt es nur ein prozentuales Wachstum, was aber dann auch immer nur sehr zufällig ist. Ich würde gerne eine Exponenz einbauen, dass wohlhabende Reiche, noch Reicher werden und dann den Spieler angreifen etc...

    Wenn jemand ein paar Ideen hat, wärs echt nett :)

  3. Stimmt. Das könnte man wegmachen. Ja, da werd ich wohl ein bool einbauen :-)

    €: Ne, das Problem mit den Zufallszahlen hab ich eben auch so rausbekommen, falls du das meinst. Das ganze Handelssystem ist in der Version die du getestet hast aber eh noch nicht drinnen.

    €2: Wie ich sowas in Vollbildmodus bekomme weißt du aber auch nicht, oder? Also, dass man wie in einem Spiel nicht mal die Scrollbars und die Menüleiste der Konsole sieht...

  4. Cool. Und? Ging alles? (Bis auf das mit dem Marktplatz? (Und die Funktionen die noch nicht eingebaut sind, die da wären, marktplatz, in die schlacht, taktikbesprechung und verwaltung)) Vorallem das Speichern nach dem man den vorherigen Spielstand geladen hat, war immer großes Problem. Weiß nicht ob dass in der Version schon gefixt ist, aber bei mir gehts jetzt immerhin.

    Der Fehler war, das Strings nicht per fstream write() geschrieben bzw gelesen werden können. Darauf muss man auch erstmal kommen :D

  5. Hi....

    Hier

    void ::eventFunction()
    
    {
    
    	taxes(start);
    
    
    
    	::nympth.calculateAll(wood, stone,food,iron,gold);
    
    	::isabell.calculateAll(wood, stone,food,iron,gold);
    
    	::malark.calculateAll(wood, stone,food,iron,gold);
    
    	::tresla.calculateAll(wood, stone,food,iron,gold);
    
    	::skott.calculateAll(wood, stone,food,iron,gold);
    
    	::gregor.calculateAll(wood, stone,food,iron,gold);
    
    	::tammo.calculateAll(wood, stone,food,iron,gold);
    
    	::ariana.calculateAll(wood, stone,food,iron,gold);
    
    	::finmor.calculateAll(wood, stone,food,iron,gold);
    
    
    
    }
    durchlauf ich jeden Durchgang alle anfallenden Funktionen. die Objekte sind Gegenspieler, die mit einem Handeln können, gegen einen kämpfen etc. So nun, beim Handelssystem passiert folgender Fehler: Die Wahrscheinlichkeit, dass ein Computerspieler einen Handel vorschlägt soll 1/20 betragen. Dies habe ich so eingebaut:
    trade = rand() % 20;
    
    	
    
    
    
    	if(trade == 1)
    Bis dahin klappt auch Alles. Ab und zu wird ein Angebot rausgeschmissen, aber nur von Nymph, dh. dem, der als erstes aufgerufen wurde. Und ab und an passiert es, dass nach ihm ALLE ein Angebot stellen. Jedoch nie als erstes. Dh, an Nymph 'geht kein Weg vorbei'. Da frage ich mich: Hab ich die Zufallsvariabel falsch definiert? Bleibt die konstant? Und warum wird nur Nymph aufgerufen? Der Aufrufscode sieht folgendermaße aus: Deklaration
    player ariana("Ariana"), gregor("Gregor"), malark("Malark"), skott("Skott"), finmor("Finmor"), tresla("Tresla"), isabell("Isabell"), nympth("Nympth");
    Klasse

    Woran kann das liegen?

    #include <iostream>
    
    
    
    class player
    
    {
    
    
    
    private:
    
    	char *name;
    
    
    
    	int initNumber;
    
    	int iStatusToPlayer;
    
    	int iStatusToAi[12];
    
    	int prosperty;
    
    	int forceStrength;
    
    	int development;
    
    	int timesTradedWithPlayer;// Variable der Entwicklung, 
    
    	// welche jedes Mal um enen Bestimmten Prozentwert geändert wird. Verhindert zu starke Sprünge in "Prosperty"
    
    	
    
    	float aiWood,
    
    		aiStone,
    
    		aiIron,
    
    		aiGold,
    
    		aiFood,
    
    		aiHumor;
    
    	int
    
    		aiInhabitants;
    
    
    
    	bool bStatusToPlayer;		//Enemy or Friend?
    
    	bool bStatusToPlayerAlly;	// Verbündeter?	
    
    	bool bStatusToAi[9];		// True = Neutral / False = Feind
    
    	bool bStatusToAiAlly[9];	// True = Verbündet / False = /
    
    
    
    public:
    
    
    
    	player(char* _name)  : name(_name)
    
    	{
    
    		this->iStatusToPlayer = 0;
    
    		this->prosperty = 0;
    
    		this->forceStrength = 0;
    
    		this->aiWood = 100;
    
    		this->aiStone = 100;
    
    		this->aiIron = 100;
    
    		this->aiFood = 100;
    
    		this->aiGold = 100;
    
    		this->aiHumor = -1.0f;
    
    		this->aiInhabitants = 100;
    
    		this->development = 0;
    
    		this->timesTradedWithPlayer = 0;
    
    
    
    		for(int i = 0; i<sizeof(this->bStatusToAi);i++)
    
    		{
    
    			this->bStatusToAi[i] = true;
    
    			this->bStatusToAiAlly[i] = false;
    
    		}
    
    		this->bStatusToPlayer = true;
    
    		this->bStatusToPlayerAlly = false;
    
    }
    
    
    
    	
    
    
    
    	void calculateDevelopment();
    
    	void calculateRessources();
    
    	void calculateStatusToAi();
    
    	void calculateStatusToPlayer();
    
    	void calculateForceStrengthAndHumor();
    
    	void calculateAll(float &lWood, float &lStone, float &lFood, float &lIron, float &lGold);
    
    	void checkEvents();	  // Kontrolliert ob irgendwelche Werte besonders niedrig sind. Wenn ja, löst es Folgen aus 
    
    	void tradeWithPlayer(float &lWood, float &lStone, float &lFood, float &lIron, float &lGold);
    
    
    
    
    
    };
    Und die hier Cpp datei der Klasse (bzw der relevante teil)
    void player::calculateAll(float &lWood, float &lStone, float &lFood, float &lIron, float &lGold)
    
    {
    
    	calculateDevelopment();
    
    	calculateForceStrengthAndHumor();
    
    	//this->calculateRessources();
    
    	//this->calculateStatusToAi();
    
    	//this->calculateStatusToPlayer();
    
    	checkEvents();
    
    	tradeWithPlayer(lWood, lStone, lFood, lIron, lGold);
    
    }
    
    
    
    void player::tradeWithPlayer(float &lWood, float &lStone, float &lFood, float &lIron, float &lGold)
    
    {
    
    	string str1, str2;
    
    	time(&t);
    
    	srand((unsigned int)t);   
    
    
    
    	
    
    	int trade;
    
    	trade = rand() % 20;
    
    	float *ptr1, *ptr2;
    
    
    
    	if(trade == 1)
    
    	{
    
    		int item1;
    
    		int item2;
    
    		int itemMaxGive, itemMaxTake;
    
    		int numbersGive, numbersTake;
    
    
    
    		
    
    	do
    
    	{
    
    			item1 = rand() % 5;
    
    			item2 = rand() % 5;
    
    		if(item1==0)
    
    			item1++;
    
    		if(item2==0)
    
    			item2++;
    
    		
    
    		switch(item1)
    
    		{
    
    		case 1:
    
    			{
    
    				itemMaxTake = lWood;
    
    				str1 = "Holz";
    
    				ptr1 = &lWood;
    
    				break;
    
    			}
    
    		case 2:
    
    			{
    
    				itemMaxTake = lIron;
    
    				str1 = "Eisen";
    
    				ptr1 = &lIron;
    
    				break;
    
    			}
    
    		case 3:
    
    			{
    
    				itemMaxTake = lStone;
    
    				str1 = "Stein";
    
    				ptr1 = &lStone;
    
    				break;
    
    			}
    
    		case 4: 
    
    			{
    
    				itemMaxTake = lGold;
    
    				str1 = "Gold";
    
    				ptr1 = &lGold;
    
    				break;
    
    			}
    
    		case 5:
    
    			{
    
    				itemMaxTake = lFood;
    
    				str1 = "Nahrung";
    
    				ptr1 = &lFood;
    
    				break;
    
    			}
    
    
    
    		}
    
    
    
    		switch(item2)
    
    		{
    
    		case 1:
    
    			{
    
    				itemMaxGive = aiWood;
    
    				str2 = "Holz";
    
    				ptr2 = &lWood;
    
    				break;
    
    			}
    
    		case 2:
    
    			{
    
    				itemMaxGive = aiIron;
    
    				str2 = "Eisen";
    
    				ptr2 = &lIron;
    
    				break;
    
    			}
    
    		case 3:
    
    			{
    
    				itemMaxGive = aiStone;
    
    				str2 = "Stein";
    
    				ptr2 = &lStone;
    
    				break;
    
    			}
    
    		case 4: 
    
    			{
    
    				itemMaxGive = aiGold;
    
    				str2 = "Gold";
    
    				ptr2 = &lGold;
    
    				break;
    
    			}
    
    		case 5:
    
    			{
    
    				itemMaxGive = aiFood;
    
    				str2 = "Nahrung";
    
    				ptr2 = &lFood;
    
    				break;
    
    			}
    
    
    
    		}
    
    
    
    	}while(itemMaxGive == 0);
    
    		numbersGive = rand() % itemMaxGive;
    
    		numbersTake = rand() % itemMaxGive*1.5f;
    
    
    
    		char choice;
    
    		bool choiceOK = false;
    
    		while(choiceOK == false)
    
    		{
    
    			cout << name  << " macht ihnen ein Handelsangebot: " << endl;
    
    			cout << numbersGive << " " << str1 << " gegen " << numbersTake << " " << str2 << endl;
    
    			cout << "Moechten sie annehmen? [J]a oder [N]ein" << endl;
    
    			cin >> choice;
    
    			if(!cin.fail())
    
    			{
    
    			
    
    				if(choice == 'J' || choice == 'j' )
    
    				{
    
    					if(*ptr1>=numbersTake)
    
    					{
    
    							*ptr1 -= numbersTake;
    
    							*ptr2 += numbersGive;
    
    
    
    							cout << "<" << name << "> Es freut mich, mit ihnen gehandelt zu haben!" << endl;
    
    							cin.sync();
    
    							cin.get();
    
    					}
    
    
    
    					else
    
    					{
    
    						cout << "Du hast nicht genug Rohstoffe fuer diesen Handel!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    					}
    
    					choiceOK = true;
    
    				}
    
    				if(choice == 'N' || choice == 'n')
    
    				{
    
    					cout << "<" << name << "> Jedem das Seine..." << endl;
    
    					cin.sync();
    
    					cin.get();
    
    					choiceOK = true;
    
    				}
    
    			}
    
    		}
    
    
    
    	}
    
    
    
    	trade = rand() % 20;
    
    }

  6. Hm ok...

    Aber die Lademethode kann ja eh noch nicht das Gelbe vom Ei sein. zb möchte ich jetzt ein bool array von der größe 30 speichern und laden. Dazu müsste ich mit meiner jetzigen Methode 30 stringstream objekte anlegen. Geht das nicht auch mit einer for-Schleife und nur einem Stringstream? Meine Versuche sind bisher kläglich gescheitert...

    Bisherige Load und Save Funktion:

    bool save()
    
    {
    
    	fstream f;
    
    	f.open("thevillage/spielstand.dat", ios::out | ios::binary);
    
    	if(f)
    
    	{
    
    		f << wood << endl;
    
    		f << iron << endl;
    
    		f << stone << endl;
    
    		f << food << endl;
    
    		f << gold << endl;
    
    		f <<experience << endl;
    
    		f <<prestige << endl;
    
    		f <<xWood << endl;
    
    		f <<xStone << endl;
    
    		f <<xIron << endl;
    
    		f <<xGold << endl;
    
    		f <<xFood << endl;
    
    		f <<inhabitants << endl;
    
    		f <<::bWoodmine << endl;
    
    		f <<::bIronmine << endl;
    
    		f <<::bStonemine << endl;
    
    		f <<::bFarm << endl;
    
    		f <<::bMarketplace << endl;
    
    		f <<::bKaserne << endl;
    
    		f <<::fighter << endl;
    
    		f <<::horsefighter << endl;
    
    		f <<::swordfighter << endl;
    
    		f <<::bowfighter << endl;
    
    		f <<::dialogCounter << endl;
    
    		f.write((char *)&marketplace, sizeof(marketplace));
    
    		f.write((char *)&ironmine, sizeof(ironmine));
    
    		f.write((char *)&woodmine, sizeof(woodmine));
    
    		f.write((char *)&stonemine, sizeof(stonemine));
    
    		f.write((char *)&farm, sizeof(farm));
    
    		f.write((char *)&kaserne, sizeof(kaserne));
    
    	
    
    
    
    	f.close();
    
    
    
    	return true;
    
    	}
    
    	
    
    	else
    
    		return false;
    
    }
    
    
    
    bool load()
    
    {
    
    	fstream f;
    
    	string s;
    
    	f.open("thevillage/spielstand.dat", ios::in | ios::binary);
    
    	if(f)
    
    	{
    
    		stringstream ss1;
    
    		getline(f,s);
    
    		ss1 << s;
    
    		ss1 >> wood;
    
    
    
    		stringstream ss2;
    
    		getline(f,s);
    
    		ss2 << s;
    
    		ss2 >> iron;
    
    
    
    		stringstream ss3;
    
    		getline(f,s);
    
    		ss3 << s;
    
    		ss3 >> stone;
    
    
    
    		stringstream ss4;
    
    		getline(f,s);
    
    		ss4 << s;
    
    		ss4 >> food;
    
    
    
    		stringstream ss5;
    
    		getline(f,s);
    
    		ss5 << s;
    
    		ss5 >> gold;
    
    
    
    		stringstream ss6;
    
    		getline(f,s);
    
    		ss6 << s;
    
    		ss6 >> experience;
    
    
    
    		stringstream ss7;
    
    		getline(f,s);
    
    		ss7 << s;
    
    		ss7 >> prestige;
    
    
    
    		stringstream ss8;
    
    		getline(f,s);
    
    		ss8 << s;
    
    		ss8 >> xWood;
    
    
    
    		stringstream ss9;
    
    		getline(f,s);
    
    		ss9 << s;
    
    		ss9 >> xStone;
    
    
    
    		stringstream ss10;
    
    		getline(f,s);
    
    		ss10 << s;
    
    		ss10 >> xIron;
    
    
    
    		stringstream ss11;
    
    		getline(f,s);
    
    		ss11 << s;
    
    		ss11 >> xGold;
    
    
    
    		stringstream ss12;
    
    		getline(f,s);
    
    		ss12 << s;
    
    		ss12 >> xFood;
    
    
    
    		stringstream ss13;
    
    		getline(f,s);
    
    		ss13 << s;
    
    		ss13 >> inhabitants;
    
    
    
    		stringstream ss14;
    
    		getline(f,s);
    
    		ss14 << s;
    
    		ss14 >> bWoodmine;
    
    
    
    		stringstream ss15;
    
    		getline(f,s);
    
    		ss15 << s;
    
    		ss15 >> bIronmine;
    
    
    
    		stringstream ss16;
    
    		getline(f,s);
    
    		ss16 << s;
    
    		ss16 >> bStonemine;
    
    
    
    		stringstream ss17;
    
    		getline(f,s);
    
    		ss17 << s;
    
    		ss17 >> bFarm;
    
    
    
    		stringstream ss18;
    
    		getline(f,s);
    
    		ss18 << s;
    
    		ss18 >> bMarketplace;
    
    
    
    		stringstream ss19;
    
    		getline(f,s);
    
    		ss19 << s;
    
    		ss19 >> bKaserne;
    
    
    
    		stringstream ss20;
    
    		getline(f,s);
    
    		ss20 << s;
    
    		ss20 >> fighter;
    
    
    
    		stringstream ss21;
    
    		getline(f,s);
    
    		ss21 << s;
    
    		ss21 >> horsefighter;
    
    
    
    		stringstream ss22;
    
    		getline(f,s);
    
    		ss22 << s;
    
    		ss22 >> swordfighter;
    
    
    
    		stringstream ss23;
    
    		getline(f,s);
    
    		ss23 << s;
    
    		ss23 >> bowfighter;
    
    		
    
    		stringstream ss24;
    
    		getline(f,s);
    
    		ss24 << s;
    
    		ss24 >> ::dialogCounter;
    
    
    
    		f.read((char *)&marketplace, sizeof(marketplace));
    
    		f.read((char *)&ironmine, sizeof(ironmine));
    
    		f.read((char *)&woodmine, sizeof(woodmine));
    
    		f.read((char *)&stonemine, sizeof(stonemine));
    
    		f.read((char *)&farm, sizeof(farm));
    
    		f.read((char *)&kaserne, sizeof(kaserne));
    
    		return true;
    
    	}
    
    	
    
    	else
    
    		return false;
    
    }

  7. Ah, genau.. Das mache ich jetzt mal.

    Ah, just in diesem Moment: Habe mal bei der Load-Funktion die Klasseninstanzen rausgenommen und voila: Es geht. Sicherlich liegt der Fehler dann in dem Code-Schnipsel hier:

    /*f2.read((char *)&marketplace, sizeof(marketplace));
    
    		f2.read((char *)&ironmine, sizeof(ironmine));
    
    		f2.read((char *)&woodmine, sizeof(woodmine));
    
    		f2.read((char *)&stonemine, sizeof(stonemine));
    
    		f2.read((char *)&farm, sizeof(farm));
    
    		f2.read((char *)&kaserne, sizeof(kaserne));*/
    Wird dem File überhaupt gesagt, wo er stonemine und so lesen soll? Oder liest der immer vom Anfang? Weil ein getline ist das ja eigentlich nicht oder? Die Klasse der Instanzen ist in der build.h und heißt:
    #include <iostream>
    
    #include <string>
    
    
    
    using namespace std;
    
    
    
    class buildings
    
    {
    
    private:
    
    	float c_wood,
    
    		c_iron,
    
    		c_stone,
    
    		c_food,
    
    		c_gold;
    
    	float
    
    		m_wood,
    
    		m_iron,
    
    		m_stone,
    
    		m_gold,
    
    		m_food,
    
    		m_prestige,
    
    		m_experience;
    
    	string aName;
    
    	float level;
    
    
    
    public:
    
    
    
    	void build(float *wood, 
    
    				float *iron, 
    
    				float *stone, 
    
    				float *gold, 
    
    				float *food, 
    
    				float *m_prestige, 
    
    				float *experience,
    
    				float *m_wood, 
    
    				float *m_iron, 
    
    				float *m_stone,
    
    				float *m_gold, 
    
    				float *m_food);
    
    
    
    		 buildings();
    
    	void setKosten();
    
    	void getKosten();
    
    
    
    	bool check(float wood, 
    
    				float iron, 
    
    				float stone, 
    
    				float gold,
    
    				float food);
    
    
    
    	float getLevel();
    
    	float setLevel(float _level_);
    
    
    
    	void InitValues(float c_wood,
    
    					float c_iron,
    
    					float c_stone,
    
    					float c_food,
    
    					float c_gold,
    
    					float m_wood,
    
    					float m_iron,
    
    					float m_stone,
    
    					float m_gold,
    
    					float m_food,
    
    					float m_prestige,
    
    					string aName);
    
    	
    
    
    
    };

  8. Danke für die Antwort! Hatte ich eben auch gesehen, leider war es nicht der Fehler.

    Kurioserweise ging dass mit dem laden und speichern bis vor unbestimmte Zeit. Danach hab ich mich an ein paar weitere Funktionen gemacht, vllt. ein wenig dran rumgeschruabt an der Load, aus Zeitgründen aber nicht mehr so häufig gespeichert... Und auf einmal gings nicht mehr...

  9. Danke schonmal! return 0 war leider nicht der Fehler. Habe jetzt herausgefunden, dass der Fehler nur passiert, wenn ich am Anfang sage, "Ja, letzten Spielstand laden", also J oder j eingebe. Vermutlich läuft beim schreiben und laden etwas falsch. Das sieht mir eh noch sehr unprofessionell aus. Mach ich irgendwo einen Fehler da? Denn, wenn ich am Anfang nichts lade, geht alles einwandfrei... Vielleicht ein Fehler beim laden der Klasseninstanzen?

    Hier mal die load() und save(), alleine, falls man sie im Chaos da nicht findet :D

    Hatte eben entdeckt, dass ich den Ladestream nicht geschlossen hab. War aber auch nicht der entscheidende Fehler...

    bool save()
    
    {
    
    	fstream f;
    
    	f.open("thevillage/spielstand.dat", ios::out | ios::binary);
    
    	if(f)
    
    	{
    
    		f << wood << endl;
    
    		f << iron << endl;
    
    		f << stone << endl;
    
    		f << food << endl;
    
    		f << gold << endl;
    
    		f <<experience << endl;
    
    		f <<prestige << endl;
    
    		f <<xWood << endl;
    
    		f <<xStone << endl;
    
    		f <<xIron << endl;
    
    		f <<xGold << endl;
    
    		f <<xFood << endl;
    
    		f <<inhabitants << endl;
    
    		f <<::bWoodmine << endl;
    
    		f <<::bIronmine << endl;
    
    		f <<::bStonemine << endl;
    
    		f <<::bFarm << endl;
    
    		f <<::bMarketplace << endl;
    
    		f <<::bKaserne << endl;
    
    		f <<::fighter << endl;
    
    		f <<::horsefighter << endl;
    
    		f <<::swordfighter << endl;
    
    		f <<::bowfighter << endl;
    
    		f <<::dialogCounter << endl;
    
    		f.write((char *)&marketplace, sizeof(marketplace));
    
    		f.write((char *)&ironmine, sizeof(ironmine));
    
    		f.write((char *)&woodmine, sizeof(woodmine));
    
    		f.write((char *)&stonemine, sizeof(stonemine));
    
    		f.write((char *)&farm, sizeof(farm));
    
    		f.write((char *)&kaserne, sizeof(kaserne));
    
    	
    
    
    
    	f.close();
    
    
    
    	return true;
    
    	}
    
    	
    
    	else
    
    		return false;
    
    }
    
    
    
    bool load()
    
    {
    
    	fstream f;
    
    	string s;
    
    	f.open("thevillage/spielstand.dat", ios::in | ios::binary);
    
    	if(f)
    
    	{
    
    		stringstream ss1;
    
    		getline(f,s);
    
    		ss1 << s;
    
    		ss1 >> wood;
    
    
    
    		stringstream ss2;
    
    		getline(f,s);
    
    		ss2 << s;
    
    		ss2 >> iron;
    
    
    
    		stringstream ss3;
    
    		getline(f,s);
    
    		ss3 << s;
    
    		ss3 >> stone;
    
    
    
    		stringstream ss4;
    
    		getline(f,s);
    
    		ss4 << s;
    
    		ss4 >> food;
    
    
    
    		stringstream ss5;
    
    		getline(f,s);
    
    		ss5 << s;
    
    		ss5 >> gold;
    
    
    
    		stringstream ss6;
    
    		getline(f,s);
    
    		ss6 << s;
    
    		ss6 >> experience;
    
    
    
    		stringstream ss7;
    
    		getline(f,s);
    
    		ss7 << s;
    
    		ss7 >> prestige;
    
    
    
    		stringstream ss8;
    
    		getline(f,s);
    
    		ss8 << s;
    
    		ss8 >> xWood;
    
    
    
    		stringstream ss9;
    
    		getline(f,s);
    
    		ss9 << s;
    
    		ss9 >> xStone;
    
    
    
    		stringstream ss10;
    
    		getline(f,s);
    
    		ss10 << s;
    
    		ss10 >> xIron;
    
    
    
    		stringstream ss11;
    
    		getline(f,s);
    
    		ss11 << s;
    
    		ss11 >> xGold;
    
    
    
    		stringstream ss12;
    
    		getline(f,s);
    
    		ss12 << s;
    
    		ss12 >> xFood;
    
    
    
    		stringstream ss13;
    
    		getline(f,s);
    
    		ss13 << s;
    
    		ss13 >> inhabitants;
    
    
    
    		stringstream ss14;
    
    		getline(f,s);
    
    		ss14 << s;
    
    		ss14 >> bWoodmine;
    
    
    
    		stringstream ss15;
    
    		getline(f,s);
    
    		ss15 << s;
    
    		ss15 >> bIronmine;
    
    
    
    		stringstream ss16;
    
    		getline(f,s);
    
    		ss16 << s;
    
    		ss16 >> bStonemine;
    
    
    
    		stringstream ss17;
    
    		getline(f,s);
    
    		ss17 << s;
    
    		ss17 >> bFarm;
    
    
    
    		stringstream ss18;
    
    		getline(f,s);
    
    		ss18 << s;
    
    		ss18 >> bMarketplace;
    
    
    
    		stringstream ss19;
    
    		getline(f,s);
    
    		ss19 << s;
    
    		ss19 >> bKaserne;
    
    
    
    		stringstream ss20;
    
    		getline(f,s);
    
    		ss20 << s;
    
    		ss20 >> fighter;
    
    
    
    		stringstream ss21;
    
    		getline(f,s);
    
    		ss21 << s;
    
    		ss21 >> horsefighter;
    
    
    
    		stringstream ss22;
    
    		getline(f,s);
    
    		ss22 << s;
    
    		ss22 >> swordfighter;
    
    
    
    		stringstream ss23;
    
    		getline(f,s);
    
    		ss23 << s;
    
    		ss23 >> bowfighter;
    
    		
    
    		stringstream ss24;
    
    		getline(f,s);
    
    		ss24 << s;
    
    		ss24 >> ::dialogCounter;
    
    
    
    		f.read((char *)&marketplace, sizeof(marketplace));
    
    		f.read((char *)&ironmine, sizeof(ironmine));
    
    		f.read((char *)&woodmine, sizeof(woodmine));
    
    		f.read((char *)&stonemine, sizeof(stonemine));
    
    		f.read((char *)&farm, sizeof(farm));
    
    		f.read((char *)&kaserne, sizeof(kaserne));
    
    		return true;
    
    	}
    
    	
    
    	else
    
    		return false;
    
    }

  10. Aaargh... Wo steckt der doofe Fehler?

    Habe ein Programm, welches ein Menü besitzt. Dieses läuft in einer do-While schleife, welche verlassen wird, wenn bool end = true wird. Wenn dies der Fall ist, schmiert das Programm mit folgender Fehlermeldung ab:

    Unbehandelte Ausnahme bei 0x5aa3ad84 (msvcp100d.dll) in TheVillage.exe: 0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x0a670b5b.
    Jetzt hab ich natürlich versucht den Fehler zu finden. Habe immer ein paar Sachen ausgeschlossen, aber Nichts war es. Dann setzt ich den Haltepuntk DIREKT ans Ende. Also an die }-Klammer der main Funktion: Bis dahin geht alles. Also: Der Fehler entsteht beim Verlassen der Main-Funktion? Wodurch kann das entstehen? Den Programm-Code poste ich lieber nicht, der ist seeehr unübersichtlich und vorallem lang... Oder... Na, was solls... Wenn wer durchsteigt:

    Interessant dürfte nur die Main funktion und die menue() Funktion sein. Der Fehler entsteht, wenn ich nur das Menü betrete und per 0 verlassen will. Den ganzen Rest hab ich nur gepostet, falls ihr da den Fehler vermutet... main.cpp
    #include <string>
    
    #include <iostream>
    
    #include "build.h"
    
    #include "ic.hpp"
    
    #include <fstream>
    
    #include <sstream>
    
    #include <windows.h>
    
    #include <direct.h>
    
    #pragma comment( lib, "winmm.lib" )
    
    using namespace ic;
    
    using namespace ic::shorties;
    
    using namespace std;
    
    
    
    //FUNKTIONEN//
    
    
    
    void getRessources();
    
    void setRessources(float gold, float food, float iron, float wood, float stone);
    
    int getInhabitants();
    
    void setInhabitants(int inhabitants, bool delete_or_create);
    
    void build(int init, int number);
    
    buildings initBuildings(int init);
    
    bool checkRessources(buildings marketplace);
    
    
    
    void menue();
    
    void buildingMenue();
    
    void fightMenue();
    
    
    
    void earnRessources(int init, int amount);
    
    bool save();
    
    bool load();
    
    
    
    void dialogs(int dialog, int _event, int _eventinfo);	// int dialog -> Häufigkeit des Menüaufrufes) int _event -> Spezielles Event.
    
    
    
    // GEBÄUDE //
    
    buildings marketplace, farm, woodmine, stonemine, ironmine, kaserne;
    
    // BOOLS //
    
    
    
    bool bMarketplace,
    
    	bIronmine,
    
    	bWoodmine,
    
    	bStonemine,
    
    	bKaserne,
    
    	bFarm;
    
    
    
    // INT //
    
    
    
    float wood = 50;
    
    float iron = 50;
    
    float stone = 50;
    
    float food = 50;
    
    float gold = 50;
    
    float prestige = 150;
    
    float experience = 150;
    
    
    
    bool ende = false;
    
    
    
    float xWood = 1, 
    
    	xIron = 1,
    
    	xStone = 1,
    
    	xGold = 1,
    
    	xFood = 1;
    
    
    
    int inhabitants = 1000;
    
    int fighter = 0;
    
    int swordfighter,
    
    	bowfighter,
    
    	horsefighter,
    
    	dialogCounter = 0,
    
    	sessionCounter = 0;
    
    
    
    void inline dot(string t)
    
    {
    
    	cout << t;
    
    	for(int i = 0; i<3; i++)
    
    	{
    
    		cout <<".";
    
    	Sleep(500);
    
    	}
    
    }
    
    
    
    void inline typewriter(string t, int sleep)
    
    {
    
    	   
    
    	for(int i = 0; i<t.size(); i++)
    
    	{
    
    		if(t[i]!='§')
    
    		{
    
    			cout << t[i];
    
    			Sleep(sleep);
    
    		}
    
    		else
    
    			Sleep(300);
    
    	}
    
    }
    
    
    
    int main()
    
    {
    
    	SetConsoleTitle( "TheVillage" );
    
    	_mkdir("thevillage");
    
    	char jn, jn2;
    
    	maximize();
    
    	cout << "Intro ueberspringen? [J]a oder [N]ein?" << endl;
    
    	cin >> jn2;
    
    	if( jn2 == 'j' || jn2 == 'J')
    
    	{
    
    			
    
    	}
    
    	if(cin.fail() || jn2 == 'n' || jn2 == 'N' )
    
    	{
    
    		system("cls");
    
    
    
    		//PlaySound(MAKEINTRESOURCE(1001), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC | SND_LOOP | SND_NODEFAULT);
    
    		Sleep(12000);
    
    		typewriter("Maerz§§.12§§.§1588\n",150);
    
    		Sleep(3000);
    
    		typewriter("\nDer Wind weht...",100);
    
    		Sleep(1000);
    
    		typewriter("\nAn unseren Klingen klebt Blut",100);
    
    		Sleep(2000);
    
    		typewriter("\nDoch wir haben verloren.§§§§§",100); 
    
    		Sleep(2000);
    
    		typewriter("\nUnsern Besitz!",100);
    
    		Sleep(2000);
    
    		typewriter("\nUnsere Ehre! §§§§Und...",100);
    
    		typewriter("§§§§§§§§§§§ \n\n\n\t\t\t\tUnser Dorf!\n\n\n",150);
    
    		Sleep(2000);
    
    		typewriter("Hilf uns, unser Dorf wiederaufzubauen!§§§§§§§ \nHilf uns, unsere Ehre wiederzuer§langen! \nHilf uns,§§§§§ uns zu§§§§ raechen!\n",100);
    
    		Sleep(3000);
    
    		typewriter("Wir sind nicht viele... \nDoch wir haben einen Willen.\n\n Und Nichts auf dieser Erde ist staerker als... \n Ein Wille, dessen Zeit gekommen ist... \n Dessen Zeit§§ JETZT ist!",100);
    
    		typewriter("Folgst du uns auf unserem Weg?",100);
    
    		Sleep(500);
    
    		cout << "[J]a / [N]ein" << endl;
    
    		cin >> jn;
    
    		if(cin.fail() || jn == 'N' || jn == 'n')
    
    			exit(0);
    
    
    
    		typewriter("\t\t\t||==============================||\n",50);
    
    		typewriter("\t\t\t||							  ||\n",0);
    
    		typewriter("\t\t\t||	  Herzlich Willkommen	 ||\n",50);
    
    		typewriter("\t\t\t||			  in			  ||\n",50);
    
    		typewriter("\t\t\t||		  TheVillage		  ||\n",50);
    
    		typewriter("\t\t\t||							  ||\n",0);
    
    		typewriter("\t\t\t||==============================||\n",50);
    
    		cin.ignore();
    
    
    
    	}
    
    	system("cls");
    
    	char c_load;																// Spielstand laden? // 
    
    	cout << "Letzten Spielstand laden? J = JA" << endl;
    
    	cin >> c_load;
    
    	if(c_load == 'j' || c_load == 'J')
    
    	{
    
    		if(load()==true)
    
    		{
    
    			cout << "Spielstand erfolgreich geladen!" << endl;	
    
    			cin.get();//JA
    
    		}
    
    
    
    		else
    
    		{
    
    			cout << "Spielstand konnte nicht geladen werden!" << endl;	// Fehler beim Laden
    
    			cin.get();
    
    		}
    
    
    
    	}
    
    	do
    
    	{
    
    	menue();
    
    	}while(ende==false);
    
    
    
    }
    
    
    
    void menue()
    
    {
    
    	//PlaySound(MAKEINTRESOURCE(1002), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC | SND_LOOP | SND_NODEFAULT);
    
    
    
    	
    
    
    
    		//++dialogCounter;		// Erhöht Variable zum zählen der Menü-Aufrufe. 
    
    
    
    		system("cls");
    
    
    
    		int choice = 0;			
    
    
    
    		////////////////
    
    		cout << "[1] - Rohstoffe einsehen \t\t||" << endl;
    
    		cout << "[2] - Baumenue \t\t\t\t||" << endl;
    
    		cout << "[3] - Holz abbauen \t\t\t||" << endl;
    
    		cout << "[4] - Stein abbauen \t\t\t||" << endl;
    
    		cout << "[5] - Eisen abbauen \t\t\t||" << endl;
    
    		cout << "[6] - Nahrung ernten \t\t\t||" << endl;
    
    		cout << "[7] - Kampfmenue \t\t\t||" << endl;
    
    		cout << "[0] - Spiel speichern & verlassen \t||" << endl;
    
    		/////////////////
    
    
    
    		//dialogs(dialogCounter,0,0);
    
    
    
    		cin >> choice;
    
    
    
    		if (cin.fail() )		// Wenn falsche Eingabe, bleibe in der do-Schleife!
    
    		{
    
    			cin.clear(); 
    
    			cin.sync(); 
    
    		}
    
    		else				// Wenn richtige Eingabe, werte sie aus
    
    		{
    
    			switch(choice)
    
    			{
    
    			case 0:
    
    				{
    
    					int save_or_not;
    
    					cout << "Spielstand speichern? [1] -> JA" << endl;
    
    					cin >> save_or_not;
    
    					if(save_or_not == 1)
    
    					{
    
    						if(save() == true)
    
    						{
    
    							cout << "Spielstand gespeichert!" << endl;
    
    							cin.sync();
    
    							cin.get();
    
    							
    
    						}
    
    
    
    						else
    
    						{
    
    							cout << "Spielstand konnte nicht gespeichert werden!" << endl;
    
    							cin.sync();
    
    							cin.get();
    
    							
    
    						}
    
    					}
    
    					
    
    					ende = true;
    
    					break;
    
    				}
    
    			case 1:
    
    				{
    
    					::getRessources();
    
    				
    
    					cin.get();
    
    					break;
    
    				}
    
    			case 2:
    
    				{
    
    					buildingMenue();
    
    					break;
    
    				}
    
    			case 3:
    
    				{
    
    					if(bWoodmine == true)
    
    						earnRessources(1,1);
    
    					else
    
    					{
    
    						cout << "Sie muessen erst eine Holzfaellerhuette bauen!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    					}
    
    
    
    					break;
    
    				}
    
    			case 4:
    
    				{
    
    					if(bStonemine == true)
    
    						earnRessources(2,1);
    
    					else
    
    					{
    
    						cout << "Sie muessen erst eine Steinmine bauen!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    					}
    
    					break;
    
    				}
    
    			case 5:
    
    				{
    
    					if(bIronmine == true)
    
    						earnRessources(3,1);
    
    					else
    
    					{
    
    						cout << "Sie muessen erst eine Eisenmine bauen!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    					}
    
    					break;
    
    				}
    
    			case 6:
    
    				{
    
    					if(bFarm == true)
    
    						earnRessources(4,1);
    
    					else
    
    					{
    
    						cout << "Sie muessen erst eine Farm bauen!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    						
    
    					}
    
    					break;
    
    				}
    
    			case 7:
    
    				{
    
    					if(bKaserne == true)
    
    						fightMenue();
    
    					else
    
    					{
    
    						cout << "Sie muessen erst eine Kaserne bauen!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    						
    
    					}
    
    					break;
    
    				}
    
    
    
    			}
    
    		}
    
    		system("cls");
    
    	
    
    
    
    }
    
    
    
    
    
    void buildingMenue()
    
    {
    
    	system("cls");
    
    	bool end = false;
    
    	int choice = 0;
    
    	do
    
    	{
    
    		cout << "[0] - Zurueck zum Obermenue " << endl;
    
    		cout << "[1] - Marktplatz bauen" << endl;
    
    		cout << "[2] - Eisenmine bauen" << endl;
    
    		cout << "[3] - Holzfaellerhuette bauen" << endl;
    
    		cout << "[4] - Steinmine bauen" << endl;
    
    		cout << "[5] - Farm bauen" << endl;
    
    		cout << "[6] - Kaserne bauen " << endl;
    
    		cin >> choice;
    
    		if (cin.fail() )
    
    			{
    
    				cin.clear(); 
    
    				cin.sync(); 
    
    			}
    
    		else
    
    		{
    
    			switch (choice)
    
    			{
    
    			case 1:
    
    				{
    
    						build(1,0);
    
    					break;
    
    				}
    
    			case 2:
    
    				{
    
    					
    
    						build(2,0);
    
    					
    
    					break;
    
    				}
    
    			case 3:
    
    				{
    
    					
    
    						build(3,0);
    
    					
    
    					break;
    
    				}
    
    			case 4:
    
    				{
    
    					
    
    						build(4,0);
    
    					
    
    					break;
    
    				}
    
    			case 5:
    
    				{
    
    					build(5,0);
    
    					
    
    					break;
    
    				}
    
    			case 6:
    
    				{
    
    					build(6,0);
    
    					
    
    					break;
    
    				}
    
    
    
    			case 7:
    
    				{
    
    					if(wood>15 && stone > 5)
    
    					{
    
    						inhabitants+= 10;
    
    						wood-=15;
    
    						stone-=5;
    
    					}
    
    					else
    
    					{
    
    						cout << "Nicht genug Rohstoffe!" << endl;
    
    						cin.sync();
    
    						cin.get();
    
    					}
    
    
    
    					break;
    
    
    
    				}
    
    			case 0:
    
    				{
    
    					end = true;
    
    					break;
    
    				}
    
    			}
    
    			
    
    		}
    
    		system("cls");
    
    	}while(end == false);
    
    }
    
    
    
    void fightMenue()
    
    {
    
    	system("cls");
    
    	bool end = false;
    
    	int choice;
    
    	do
    
    	{
    
    		system("cls");
    
    		cout << "Herzlich Willkommen im Kampfmenue!" << endl;
    
    		cout << "[0] - Zuruck zum Obermenue " << endl;
    
    		cout << "[1] - Leute ausbilden! " << endl;
    
    		cout << "[2] - Rekrutieren! " << endl;
    
    		cout << "[3] - IN DIE SCHLACHT! " << endl;
    
    		cout << "[4] - Taktische Besprechung! " << endl;
    
    		cin.sync();
    
    		cin >> choice;
    
    		if (cin.fail() )
    
    		{
    
    			cout << "Falsche Eingabe!" << endl;
    
    			cin.clear(); 
    
    			cin.sync(); 
    
    			cin.get();
    
    		}
    
    		else
    
    		{
    
    			switch(choice)
    
    			{
    
    			case 0:
    
    				{
    
    					end = true;
    
    					break;
    
    				}
    
    			case 1:
    
    				{
    
    					int t = 0;
    
    					cout << "Sie haben " << inhabitants << " ausbildbare Einwohner!" << endl;
    
    					cout << "Wie viele wollen sie ausbilden? (Kosten: 1 Gold & 1 Eisen" << endl;
    
    					cin >> t;
    
    					if(t<inhabitants && t*1 < gold && t*1 < iron)
    
    					{
    
    						gold -=1*t;
    
    						iron -=1*t;
    
    						fighter +=t;
    
    						inhabitants -=t;
    
    					}
    
    					else
    
    						cout << "Nicht genug Rohstoffe oder Einwohner!" << endl;
    
    					cin.sync();
    
    					cin.get();
    
    					break;
    
    				}
    
    			case 2:
    
    				{
    
    					bool end = false;
    
    					do
    
    					{
    
    						system("cls");
    
    						int choice;
    
    						cout << "=========================" << endl;
    
    						cout << "|| Kavellerie: " << horsefighter << endl;
    
    						cout << "|| Schwertkaempfer: " << swordfighter << endl;
    
    						cout << "|| Bogenschuetzen: " << bowfighter << endl;
    
    						cout << "=========================\n" << endl;
    
    						cout << "[0] - Zurueck zum Obermenue " << endl;
    
    						cout << "[1] - Schwertkaempfer ausbilden! \t \t [3 Eisen & 3 Gold] " << endl;
    
    						cout << "[2] - Leichte Kavellerie ausbilden! \t \t [7 Eisen & 4 Gold] " << endl;
    
    						cout << "[3] - Bogenschuetzen ausbilden! \t \t [5 Eisen & 1 Gold] " << endl;
    
    
    
    						cin.sync();
    
    						cin >> choice;
    
    						if (cin.fail() )
    
    						{
    
    							cout << "Falsche Eingabe!" << endl;
    
    							cin.clear(); 
    
    							cin.sync(); 
    
    							cin.get();
    
    
    
    						}
    
    					
    
    						else
    
    						{
    
    							switch(choice)
    
    							{
    
    							case 0:
    
    								{
    
    									end = true;
    
    									break;
    
    								}
    
    							case 1:
    
    								{
    
    									int number;
    
    									cout << "Anzahl der Einheiten angeben!" << endl;
    
    									cin >> number; 
    
    									if(number>fighter || 3*number>gold || 3*number > iron)
    
    									{
    
    										cout << "Sie haben zu wenige Kaempfer oder Rohstoffe!" << endl;
    
    										cin.sync();
    
    										cin.get();
    
    									}
    
    
    
    									else
    
    									{
    
    										cout << number << " Schwertkaempfer ausgebildet!" << endl;
    
    										swordfighter+=number;
    
    										fighter-=number;
    
    										gold-=number*3;
    
    										iron-=number*3;
    
    										cin.sync();
    
    										cin.get();
    
    									}
    
    
    
    									break;
    
    								}
    
    							case 2:
    
    								{
    
    									int number;
    
    									cout << "Anzahl der Einheiten angeben!" << endl;
    
    									cin >> number; 
    
    									if(number>fighter || 4*number>gold || 7*number > iron)
    
    									{
    
    										cout << "Sie haben zu wenige Kaempfer oder Rohstoffe!" << endl;
    
    										cin.sync();
    
    										cin.get();
    
    									}
    
    
    
    									else
    
    									{
    
    										cout << number << " Kavellerie ausgebildet!" << endl;
    
    										horsefighter+=number;
    
    										fighter-=number;
    
    										gold-=number*4;
    
    										iron-=number*7;
    
    										cin.sync();
    
    										cin.get();
    
    									}
    
    
    
    									break;
    
    								}
    
    							case 3:
    
    								{
    
    									int number;
    
    									cout << "Anzahl der Einheiten angeben!" << endl;
    
    									cin >> number; 
    
    									if(number>fighter || 1*number>gold || 5*number > iron)
    
    									{
    
    										cout << "Sie haben zu wenige Kaempfer oder Rohstoffe!" << endl;
    
    										cin.sync();
    
    										cin.get();
    
    									}
    
    
    
    									else
    
    									{
    
    										cout << number << " Bogenschuetzen ausgebildet!" << endl;
    
    										bowfighter+=number;
    
    										fighter-=number;
    
    										gold-=number*1;
    
    										iron-=number*5;
    
    										cin.sync();
    
    										cin.get();
    
    									}
    
    
    
    									break;
    
    								}
    
    							}
    
    						}
    
    						
    
    					}while(end == false);
    
    				}
    
    
    
    			case 3:
    
    					{
    
    						
    
    					}
    
    			}
    
    		}
    
    	}while(end==false);
    
    }
    
    
    
    void build(int init, int number)
    
    {
    
    	
    
    		switch(init)
    
    		{
    
    		case 1:
    
    			{
    
    				if(bMarketplace == false)
    
    				{
    
    					marketplace.InitValues(20,10,20,20,15,0,0,0,0,0,15,"Marktplatz");
    
    					bMarketplace = true;
    
    				}
    
    				else
    
    				{
    
    					marketplace.setKosten();
    
    				}
    
    				if(checkRessources(marketplace) == true)
    
    				{
    
    					char bauen;
    
    					marketplace.getKosten();
    
    					cout << "Wollen sie wirklich bauen?" << endl;
    
    					cin >> bauen;
    
    					if(bauen=='J' || bauen == 'j')
    
    					{
    
    						marketplace.build(&wood, &iron, &stone, &gold, &food, &prestige, &experience, &xWood, &xIron, &xStone, &xGold, &xFood);
    
    						marketplace.setLevel(0);
    
    						cout << "Marktplatz gebaut!" << endl;
    
    					}
    
    					else
    
    						cout << "Es wurde nicht gebaut!" << endl;
    
    					cin.get();
    
    					break;
    
    					
    
    					
    
    				}
    
    
    
    				else 
    
    				{
    
    					cout << "Nicht genuegend Rohstoffe verfuegbar!" << endl;
    
    					cin.get();
    
    				}
    
    
    
    				break;
    
    	
    
    			}
    
    
    
    		case 2:
    
    			{
    
    				if(bIronmine == false)
    
    				{
    
    					ironmine.InitValues(10,10,10,10,10,0.0f,1.25f,0.0f,0,0,0,"Eisenmine");
    
    					bIronmine = true;
    
    				}
    
    				else
    
    				{
    
    					ironmine.setKosten();
    
    				}
    
    				if(checkRessources(ironmine) == true)
    
    				{
    
    					char bauen;
    
    					ironmine.getKosten();
    
    					cout << "Wollen sie wirklich bauen?" << endl;
    
    					cin >> bauen;
    
    					if(bauen=='J' || bauen=='j')
    
    					{
    
    						ironmine.build(&wood, &iron, &stone, &gold, &food, &prestige, &experience, &xWood, &xIron, &xStone, &xGold, &xFood);
    
    						ironmine.setLevel(0);
    
    						cout << "Marktplatz gebaut!" << endl;
    
    					}
    
    					else
    
    						cout << "Es wurde nicht gebaut!" << endl;
    
    					cin.get();
    
    					
    
    				}
    
    
    
    				else 
    
    				{
    
    					cout << "Nicht genuegend Rohstoffe verfuegbar!" << endl;
    
    					cin.get();
    
    				}
    
    
    
    				break;
    
    	
    
    			}
    
    
    
    		case 3:
    
    			{
    
    				if(bWoodmine == false)
    
    				{
    
    					woodmine.InitValues(10,10,10,10,10,1.25,0,0,0,0,0,"Holzfaellerhuette");
    
    					bWoodmine = true;
    
    				}
    
    				else
    
    				{
    
    					woodmine.setKosten();
    
    				}
    
    				if(checkRessources(woodmine) == true)
    
    				{
    
    					char bauen;
    
    					woodmine.getKosten();
    
    					cout << "Wollen sie wirklich bauen?" << endl;
    
    					cin >> bauen;
    
    					if(bauen =='J' || bauen == 'j')
    
    					{
    
    						woodmine.build(&wood, &iron, &stone, &gold, &food, &prestige, &experience, &xWood, &xIron, &xStone, &xGold, &xFood);
    
    						woodmine.setLevel(0);
    
    						cout << "Holzfaellerhuette gebaut!" << endl;
    
    					}
    
    					else
    
    						cout << "Es wurde nicht gebaut!" << endl;
    
    					cin.get();
    
    					
    
    				}
    
    
    
    				else 
    
    				{
    
    					cout << "Nicht genuegend Rohstoffe verfuegbar!" << endl;
    
    					cin.get();
    
    				}
    
    
    
    				break;
    
    	
    
    			}
    
    
    
    		case 4:
    
    			{
    
    				if(bStonemine == false)
    
    				{
    
    					stonemine.InitValues(10,10,10,10,10,0,0,1.25,0,0,5,"Steinmine");
    
    					bStonemine = true;
    
    				}
    
    				else
    
    				{
    
    					stonemine.setKosten();
    
    				}
    
    				if(checkRessources(stonemine) == true)
    
    				{
    
    					char bauen;
    
    					stonemine.getKosten();
    
    					cout << "Wollen sie wirklich bauen?" << endl;
    
    					cin >> bauen;
    
    					if(bauen=='J' || bauen=='j')
    
    					{
    
    						stonemine.build(&wood, &iron, &stone, &gold, &food, &prestige, &experience, &xWood, &xIron, &xStone, &xGold, &xFood);
    
    						stonemine.setLevel(0);
    
    						cout << "Marktplatz gebaut!" << endl;
    
    					}
    
    					else
    
    						cout << "Es wurde nicht gebaut!" << endl;
    
    					cin.get();
    
    					
    
    				}
    
    
    
    				else 
    
    				{
    
    					cout << "Nicht genuegend Rohstoffe verfuegbar!" << endl;
    
    					cin.get();
    
    				}
    
    
    
    				break;
    
    	
    
    			}
    
    
    
    		case 5:
    
    			{
    
    				if(bFarm == false)
    
    				{
    
    					farm.InitValues(10,10,10,10,10,0,0,0,0,125,10,"Farm");
    
    					bFarm = true;
    
    				}
    
    				else
    
    				{
    
    					farm.setKosten();
    
    				}
    
    				if(checkRessources(farm) == true)
    
    				{
    
    					char bauen;
    
    					farm.getKosten();
    
    					cout << "Wollen sie wirklich bauen?" << endl;
    
    					cin >> bauen;
    
    					if(bauen=='J' || bauen=='j')
    
    					{
    
    						farm.build(&wood, &iron, &stone, &gold, &food, &prestige, &experience, &xWood, &xIron, &xStone, &xGold, &xFood);
    
    						farm.setLevel(0);
    
    						cout << "Farm gebaut!" << endl;
    
    					}
    
    					else
    
    						cout << "Es wurde nicht gebaut!" << endl;
    
    					cin.get();
    
    					
    
    				}
    
    
    
    				else 
    
    				{
    
    					cout << "Nicht genuegend Rohstoffe verfuegbar!" << endl;
    
    					cin.get();
    
    				}
    
    
    
    				break;
    
    	
    
    			}
    
    
    
    		case 6:
    
    			{
    
    				if(bKaserne == false)
    
    				{
    
    					kaserne.InitValues(20,30,50,50,50,0,0,0,0,0,30,"Kaserne");
    
    					bKaserne = true;
    
    				}
    
    				else
    
    				{
    
    					kaserne.setKosten();
    
    				}
    
    				if(checkRessources(kaserne) == true)
    
    				{
    
    					char bauen;
    
    					kaserne.getKosten();
    
    					cout << "Wollen sie wirklich bauen?" << endl;
    
    					cin >> bauen;
    
    					if(bauen=='J' || bauen == 'j')
    
    					{
    
    						kaserne.build(&wood, &iron, &stone, &gold, &food, &prestige, &experience, &xWood, &xIron, &xStone, &xGold, &xFood);
    
    						kaserne.setLevel(0);
    
    						cout << "Kaserne gebaut!" << endl;
    
    					}
    
    					else
    
    						cout << "Es wurde nicht gebaut!" << endl;
    
    					cin.get();
    
    					
    
    				}
    
    
    
    				else 
    
    				{
    
    					cout << "Nicht genuegend Rohstoffe verfuegbar!" << endl;
    
    					cin.get();
    
    				}
    
    
    
    				break;
    
    	
    
    			}
    
    			
    
    		}
    
    
    
    }
    
    
    
    void getRessources()
    
    {
    
    	system("cls");
    
    	dialogs(0,1,0);
    
    			//////////////////////
    
    			cout << "=========================" << endl;
    
    			cout << "||" << wood << " Holz" << endl;
    
    			cout <<"||" << iron << " Eisen" << endl;
    
    			cout <<"||" << stone << " Stein" << endl;
    
    			cout <<"||" << food << " Nahrung" << endl;
    
    			cout <<"||" << gold << " Gold" << endl;
    
    			cout << "=========================" << endl;
    
    			cout <<"Unser Dorf hat " << inhabitants << " Einwohner " << endl;
    
    			cout << "Unser Dorf hat " << fighter << " Kaempfer. " << endl;
    
    			cout << "Kampfeinheiten findet ihr im Kampfmenue!\n" << endl;
    
    			////////////////////////
    
    	dialogs(0,1,1);
    
    			cin.get();
    
    	
    
    }
    
    
    
    bool checkRessources(buildings building)
    
    {
    
    	if(building.check(wood, iron, stone, gold, food) == true)
    
    		return true;
    
    	else 
    
    		return false;
    
    }
    
    
    
    void earnRessources(int init, int amount)
    
    {
    
    	switch(init)
    
    	{
    
    	case 1: // Holz abbauen
    
    		{
    
    			if(food > 10 && gold > 5)
    
    			{
    
    				wood += 10*xWood;
    
    				food-=10;
    
    				gold-=5;
    
    			}
    
    			else
    
    			{
    
    				cout << "Nicht genuegend Rohstoffe zum Abbauen vorhanden!" << endl;
    
    				cin.get();
    
    			}
    
    			break;
    
    		}
    
    	case 2: // Stein abbauen
    
    		{
    
    			if(food > 10 && gold > 5)
    
    			{
    
    				stone += 10*xStone;
    
    				food-=10;
    
    				gold-=5;
    
    			}
    
    			else
    
    			{
    
    				cout << "Nicht genuegend Rohstoffe zum Abbauen vorhanden!" << endl;
    
    				cin.get();
    
    			}
    
    			break;
    
    		}
    
    	case 3: // Eisen abbauen
    
    		{
    
    			if(food > 10 && gold > 5)
    
    			{
    
    				food-=10*xFood;
    
    				gold-=5;
    
    				iron += 10;
    
    			}
    
    			else
    
    			{
    
    				cout << "Nicht genuegend Rohstoffe zum Abbauen vorhanden!" << endl;
    
    				cin.get();
    
    			}
    
    			break;
    
    		}
    
    	case 4: // Nahrung abbauen
    
    		{
    
    			if(gold > 5)
    
    			{
    
    				gold-=5;
    
    				food += 10;
    
    			}
    
    			else
    
    			{
    
    				cout << "Nicht genuegend Rohstoffe zum Abbauen vorhanden!" << endl;
    
    				cin.get();
    
    			}
    
    			break;
    
    		}
    
    
    
    	}
    
    }
    
    
    
    bool save()
    
    {
    
    	fstream f;
    
    	f.open("thevillage/spielstand.dat", ios::out | ios::binary);
    
    	if(f)
    
    	{
    
    		f << wood << endl;
    
    		f << iron << endl;
    
    		f << stone << endl;
    
    		f << food << endl;
    
    		f << gold << endl;
    
    		f <<experience << endl;
    
    		f <<prestige << endl;
    
    		f <<xWood << endl;
    
    		f <<xStone << endl;
    
    		f <<xIron << endl;
    
    		f <<xGold << endl;
    
    		f <<xFood << endl;
    
    		f <<inhabitants << endl;
    
    		f <<::bWoodmine << endl;
    
    		f <<::bIronmine << endl;
    
    		f <<::bStonemine << endl;
    
    		f <<::bFarm << endl;
    
    		f <<::bMarketplace << endl;
    
    		f <<::bKaserne << endl;
    
    		f <<::fighter << endl;
    
    		f <<::horsefighter << endl;
    
    		f <<::swordfighter << endl;
    
    		f <<::bowfighter << endl;
    
    		f <<::dialogCounter << endl;
    
    		f.write((char *)&marketplace, sizeof(marketplace));
    
    		f.write((char *)&ironmine, sizeof(ironmine));
    
    		f.write((char *)&woodmine, sizeof(woodmine));
    
    		f.write((char *)&stonemine, sizeof(stonemine));
    
    		f.write((char *)&farm, sizeof(farm));
    
    		f.write((char *)&kaserne, sizeof(kaserne));
    
    	
    
    
    
    	f.close();
    
    
    
    	return true;
    
    	}
    
    	
    
    	else
    
    		return false;
    
    }
    
    
    
    bool load()
    
    {
    
    	fstream f;
    
    	string s;
    
    	f.open("thevillage/spielstand.dat", ios::in | ios::binary);
    
    	if(f)
    
    	{
    
    		stringstream ss1;
    
    		getline(f,s);
    
    		ss1 << s;
    
    		ss1 >> wood;
    
    
    
    		stringstream ss2;
    
    		getline(f,s);
    
    		ss2 << s;
    
    		ss2 >> iron;
    
    
    
    		stringstream ss3;
    
    		getline(f,s);
    
    		ss3 << s;
    
    		ss3 >> stone;
    
    
    
    		stringstream ss4;
    
    		getline(f,s);
    
    		ss4 << s;
    
    		ss4 >> food;
    
    
    
    		stringstream ss5;
    
    		getline(f,s);
    
    		ss5 << s;
    
    		ss5 >> gold;
    
    
    
    		stringstream ss6;
    
    		getline(f,s);
    
    		ss6 << s;
    
    		ss6 >> experience;
    
    
    
    		stringstream ss7;
    
    		getline(f,s);
    
    		ss7 << s;
    
    		ss7 >> prestige;
    
    
    
    		stringstream ss8;
    
    		getline(f,s);
    
    		ss8 << s;
    
    		ss8 >> xWood;
    
    
    
    		stringstream ss9;
    
    		getline(f,s);
    
    		ss9 << s;
    
    		ss9 >> xStone;
    
    
    
    		stringstream ss10;
    
    		getline(f,s);
    
    		ss10 << s;
    
    		ss10 >> xIron;
    
    
    
    		stringstream ss11;
    
    		getline(f,s);
    
    		ss11 << s;
    
    		ss11 >> xGold;
    
    
    
    		stringstream ss12;
    
    		getline(f,s);
    
    		ss12 << s;
    
    		ss12 >> xFood;
    
    
    
    		stringstream ss13;
    
    		getline(f,s);
    
    		ss13 << s;
    
    		ss13 >> inhabitants;
    
    
    
    		stringstream ss14;
    
    		getline(f,s);
    
    		ss14 << s;
    
    		ss14 >> bWoodmine;
    
    
    
    		stringstream ss15;
    
    		getline(f,s);
    
    		ss15 << s;
    
    		ss15 >> bIronmine;
    
    
    
    		stringstream ss16;
    
    		getline(f,s);
    
    		ss16 << s;
    
    		ss16 >> bStonemine;
    
    
    
    		stringstream ss17;
    
    		getline(f,s);
    
    		ss17 << s;
    
    		ss17 >> bFarm;
    
    
    
    		stringstream ss18;
    
    		getline(f,s);
    
    		ss18 << s;
    
    		ss18 >> bMarketplace;
    
    
    
    		stringstream ss19;
    
    		getline(f,s);
    
    		ss19 << s;
    
    		ss19 >> bKaserne;
    
    
    
    		stringstream ss20;
    
    		getline(f,s);
    
    		ss20 << s;
    
    		ss20 >> fighter;
    
    
    
    		stringstream ss21;
    
    		getline(f,s);
    
    		ss21 << s;
    
    		ss21 >> horsefighter;
    
    
    
    		stringstream ss22;
    
    		getline(f,s);
    
    		ss22 << s;
    
    		ss22 >> swordfighter;
    
    
    
    		stringstream ss23;
    
    		getline(f,s);
    
    		ss23 << s;
    
    		ss23 >> bowfighter;
    
    		
    
    		stringstream ss24;
    
    		getline(f,s);
    
    		ss24 << s;
    
    		ss24 >> ::dialogCounter;
    
    
    
    		f.read((char *)&marketplace, sizeof(marketplace));
    
    		f.read((char *)&ironmine, sizeof(ironmine));
    
    		f.read((char *)&woodmine, sizeof(woodmine));
    
    		f.read((char *)&stonemine, sizeof(stonemine));
    
    		f.read((char *)&farm, sizeof(farm));
    
    		f.read((char *)&kaserne, sizeof(kaserne));
    
    		return true;
    
    	}
    
    	
    
    	else
    
    		return false;
    
    }
    
    
    
    int ::getInhabitants()
    
    {
    
    	return inhabitants;
    
    }
    
    
    
    void ::dialogs(int dialog, int _event, int _eventinfo)
    
    {
    
    	if(dialog!=0)
    
    	{
    
    		if(dialog>1&& sessionCounter==0)
    
    		{
    
    			typewriter("<Mia> Willkommen zurueck! Wie geht es dir?",100);
    
    			::sessionCounter++;
    
    		}
    
    
    
    		switch(dialog)
    
    		{
    
    		case 1:
    
    			{
    
    				Sleep(500);
    
    				typewriter("<Mia>Sei gegruesst, Fremder!\n",100);
    
    				Sleep(1500);
    
    				typewriter("<Mia>Sieh dich ruhig um. Viel ist nicht mehr da.",100);
    
    				typewriter("\n<Mia>Solltest du Fragen haben, sag es mir! §Ich stehe dir zur Verfuegung... ",100);
    
    				cin.get();
    
    			}
    
    		}
    
    	}
    
    	else
    
    	{
    
    		switch(_event)
    
    		{
    
    		case 1:	// GET_Ressources 
    
    			{
    
    				if(_eventinfo!=1)
    
    				{
    
    					typewriter("Wir haben noch \n",100);
    
    				}
    
    
    
    				if(_eventinfo==1)
    
    				{
    
    					if(::wood<100 && ::stone < 100 && ::iron < 100 && ::gold < 100 && ::food < 100)
    
    					{
    
    						
    
    						typewriter("Die Lager sind fast leer!",100);
    
    
    
    							
    
    
    
    					}
    
    
    
    					float resArray[] = {wood, stone, iron, gold, food};
    
    					float min = resArray[0];
    
    					float max = resArray[0];
    
    					for(int i = 0; i<sizeof(resArray); i++)
    
    					{
    
    						if(resArray[i]<min)
    
    						min=resArray[i];
    
    					}
    
    							
    
    
    
    					if(min>0)
    
    					{
    
    						string t("Am ehesten braeuchten wir ");
    
    						if(min==wood)
    
    							t.append(" Holz.");
    
    						if(min==stone)
    
    							t.append(" Stein.");
    
    						if(min==iron)
    
    							t.append(" Eisen.");
    
    						if(min==food)
    
    							t.append(" etwas zu Essen.");
    
    						if(min==gold)
    
    							t.append(" wieder etwas Gold.");
    
    						typewriter(t,100);
    
    							}
    
    				}
    
    			}
    
    		}
    
    	}
    
    }
    
    
    
    
    
    
    
    /*
    
    void war()
    
    {
    
    	string battlefield[15][30];
    
    	for(int i = 0; i<15; i++)
    
    	{
    
    		for(int j = 0; j<30; j++)
    
    		{
    
    			battlefield[i][j] = "#";
    
    			cout << battlefield[i][j];
    
    		}
    
    		cout << endl;
    
    	}
    
    	cin.sync();
    
    	cin.get();
    
    }*/
    build.h
    #include <iostream>
    
    #include <string>
    
    
    
    using namespace std;
    
    
    
    class buildings
    
    {
    
    private:
    
    	float c_wood,
    
    		c_iron,
    
    		c_stone,
    
    		c_food,
    
    		c_gold;
    
    	float
    
    		m_wood,
    
    		m_iron,
    
    		m_stone,
    
    		m_gold,
    
    		m_food,
    
    		m_prestige,
    
    		m_experience;
    
    	string aName;
    
    	float level;
    
    
    
    public:
    
    
    
    	void build(float *wood, 
    
    				float *iron, 
    
    				float *stone, 
    
    				float *gold, 
    
    				float *food, 
    
    				float *m_prestige, 
    
    				float *experience,
    
    				float *m_wood, 
    
    				float *m_iron, 
    
    				float *m_stone,
    
    				float *m_gold, 
    
    				float *m_food);
    
    
    
    		 buildings();
    
    	void setKosten();
    
    	void getKosten();
    
    
    
    	bool check(float wood, 
    
    				float iron, 
    
    				float stone, 
    
    				float gold,
    
    				float food);
    
    
    
    	float getLevel();
    
    	float setLevel(float _level_);
    
    
    
    	void InitValues(float c_wood,
    
    					float c_iron,
    
    					float c_stone,
    
    					float c_food,
    
    					float c_gold,
    
    					float m_wood,
    
    					float m_iron,
    
    					float m_stone,
    
    					float m_gold,
    
    					float m_food,
    
    					float m_prestige,
    
    					string aName);
    
    	
    
    
    
    };
    build.cpp
    #include "build.h"
    
    
    
    buildings::buildings()
    
    {
    
    
    
    		c_wood = 0;
    
    		c_iron = 0;
    
    		c_stone = 0;
    
    		c_food = 0;
    
    		c_gold = 0;
    
    	
    
    		m_wood = 0;
    
    		m_iron = 0;
    
    		m_stone = 0;
    
    		m_gold = 0;
    
    		m_food = 0;
    
    		m_prestige = 0;
    
    		m_experience = 0;
    
    
    
    
    
    }
    
    
    
    
    
    void buildings::InitValues(float _c_wood,
    
    							float _c_iron,
    
    							float _c_stone,
    
    							float _c_food,
    
    							float _c_gold,
    
    							float _m_wood,
    
    							float _m_iron,
    
    							float _m_stone,
    
    							float _m_gold,
    
    							float _m_food,
    
    							float _m_prestige,
    
    							string _name)
    
    {
    
    	this->c_food= _c_food;
    
    	this->c_gold= _c_gold;
    
    	this->c_iron= _c_iron;
    
    	this->c_stone= _c_stone;
    
    	this->c_wood= _c_wood;
    
    	this->m_food= _m_food;
    
    	this->m_gold= _m_gold;
    
    	this->m_iron= _m_iron;
    
    	this->m_prestige= _m_prestige;
    
    	this->m_stone= _m_stone;
    
    	this->m_wood= _m_wood;
    
    	this->aName = _name;
    
    }
    
    
    
    void buildings::setKosten()
    
    {
    
    	this->c_food= c_iron*2;
    
    	this->c_gold= c_gold*2;
    
    	this->c_iron= c_iron*2;
    
    	this->c_stone= c_stone*2;
    
    	this->c_wood= c_wood*2;
    
    	this->m_food= m_food*2;
    
    	this->m_gold= m_gold*2;
    
    	this->m_iron= m_iron*2;
    
    	this->m_prestige= m_prestige*2;
    
    	this->m_stone= m_stone*2;
    
    	this->m_wood= m_wood*2;
    
    }
    
    
    
    
    
    float buildings::getLevel()
    
    {
    
    	return this->level;
    
    }
    
    
    
    float buildings::setLevel(float _level_)
    
    {
    
    	if(_level_ = 0)
    
    		this->level = ++level;
    
    	
    
    	else
    
    		this->level += _level_;
    
    
    
    	return level;
    
    }
    
    
    
    
    
    void buildings::build(float *_wood, 
    
    						float *_iron, 
    
    						float *_stone, 
    
    						float *_gold, 
    
    						float *_food, 
    
    						float *_m_prestige, 
    
    						float *_experience,
    
    						float *_m_wood, 
    
    						float *_m_iron, 
    
    						float *_m_stone,
    
    						float *_m_gold, 
    
    						float *_m_food)
    
    {
    
    	*_wood -= c_wood;
    
    	*_iron -= c_iron;
    
    	*_stone -= c_stone;
    
    	*_gold -= c_gold;
    
    	*_food -= c_food;
    
    	*_experience += m_experience;
    
    	*_m_prestige += m_prestige;
    
    	*_m_wood += (1.25f*m_stone*(level/2));
    
    	*_m_gold+= (1.25f*m_gold*(level/2));
    
    	*_m_iron += (1.25f*m_iron*(level/2));
    
    	*_m_wood += (1.25f*m_stone*(level/2));
    
    	*_m_stone += (1.25f*m_stone*(level/2));
    
    
    
    	cin.get();
    
    }
    
    
    
    
    
    bool buildings::check(float kwood, float kiron, float kstone, float kgold, float kfood)
    
    {
    
    	if(kwood > this->m_wood && kiron > this->c_iron && kstone > this->c_stone && kgold > this->c_gold && kfood > this->c_food)
    
    		return true;
    
    	else
    
    		return false;
    
    }
    
    
    
    void buildings::getKosten()
    
    {
    
    	system("cls");
    
    	cout << "\nEin(e) " << aName << " kostet: " << endl;
    
    	cout << "=========================" << endl;
    
    	cout << "|| Holz " << this->c_wood << endl;
    
    	cout << "|| Stein " << this->c_stone << endl;
    
    	cout << "|| Eisen " << this->c_iron << endl;
    
    	cout << "|| Nahrung " << this->c_food << endl;
    
    	cout << "|| Gold " << this->c_gold << endl;
    
    	cout << "=========================" << endl;
    
    	cout << "\nEin(e)" << this->aName << " steigert die Produktivitaet von " << endl;
    
    	cout << "=========================" << endl;
    
    	cout << "|| Holz um das " << this->m_wood << "-fache" << endl;
    
    	cout << "|| Stein um das " << this->m_stone<< "-fache" << endl;
    
    	cout << "|| Eisen um das " << this->m_iron<< "-fache" << endl;
    
    	cout << "|| Nahrung um das " << this->m_food<< "-fache" << endl;
    
    	cout << "|| Gold um das " << this->m_gold<< "-fache" << endl;
    
    	cout << "=========================" << endl;
    
    	cout << "\nEin(e) " << aName << " bringt " << endl;
    
    	cout << "=========================" << endl;
    
    	cout << "|| Ruhm: " << this->m_prestige << endl;
    
    	cout << "|| Erfahrung : " << this->m_experience << endl;
    
    	cout << "=========================" << endl;
    
    	
    
    }

  11. Danke! Guck ich mir morgen mal an!

    Gleich die nächste Frage (*schäm*): Habe in meinem Programm nun eine Hintergrundmelodie eingebaut (Ja, freie Lizenz und nein kein mp3). Wenn ich jetzt release ist die Datei ja nicht mit in der exe. Wie manage ich dass den, dass das Programm die Lieder quasi in sich trägt und dann in einen Ordner speichert? Weil, wenn ich das Spiel jemandem schicke, wäre es doof, die .wav's alle einzeln zuzuschicken.

    €: Ich progge btw seit dem Tag, seit dem ich dieses Topic hier eröffnet hab. Ich mir grad eingefallen :D Aber bisher war der größte Teil just lernen. Anwendungen habe ich noch keine 'nützlichen' geschrieben...

    €2: Ah, hab schon. Ressource angelegt und die PlaySound verändert. Hätte nicht gedacht, dass das so einfach ist. :)

  12. Ja, war auch nicht so gemeint...

    Weiß einer von euch, wie ich Folgendes am Besten realisieren kann?

    Ich möchte eine Art Konsole haben auf der man leicht variable Texte ausgeben kann, auch im Schreibmaschinen-Style (Alle 100ms ein Buchstabe oder so...), welche aber Vollbildmodus ist. Ich hab eine Konsole zwar schon auf fast Vollbild bekommen, jedoch sind immernoch die Scrollbars, der Titel und die Menüleiste von Windows zu sehen. Dass das mit der normalen Konsole nicht klappt, habe ich mittlerweile verstanden. Aber womit realisiert man das? Mit Win32 API muss ich ja jeden einzelnen Text per TextOut schicken, was sich nicht mit dem SchreibmaschinenStyle verträgt... Zudem wüsste ich nicht, wie ich die Texte immer untereinander bekommen sollte... OpenGL ist ja noch 10x komplizierter...

    Womit geht es denn am Besten? Ich denke mal mit einer anderen Funktion in der Win32 Api, oder?

  13. Hier, was glaubst du eigentlich immer, dass du so einen Krempel schreibst?!

    Hab ich irgendwo gesagt:

    "Heyyy... Heute hab ich im Fernsehn einen Programmierer gesehen der sau vie Kohle hatte und nun will ich auch Programierer werden. Was muss ich dafür haben und wie lange dauert es sowas wie BF3 zu programmieren?!????"

    C++ programmiere ich seit einem halben Jahr. Nur simple Konsolenanwendungen. Ein Win32 Projekt bekomm ich auch noch hin, mit ein paar Key-Abfragen, Menü etc... Das wars aber ehrlich gesagt auch schon. Ich will ja auch nicht gleich Spiele programmieren mit OpenGL bzw DirectX. Aber die Basics findet man ja auch nicht einfach so unterm Kopfkissen!

×
×
  • Neu erstellen...

Wichtige Information

Wir haben Cookies auf Deinem Gerät platziert. Das hilft uns diese Webseite zu verbessern. Du kannst die Cookie-Einstellungen anpassen, andernfalls gehen wir davon aus, dass Du damit einverstanden bist, weiterzumachen.