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
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
F:\C++ Projekte\Games\The Frog Game\GameDialog.hpp|45|error: multiple types in one declaration| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|100|error: no `void GameDialog::init()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|140|error: no `void GameDialog::loadData()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|160|error: no `void GameDialog::drawDialog()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|191|error: no `bool GameDialog::checkClicks()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp||In member function `bool GameDialog::checkClicks()':| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|210|error: 'class GameDialog' has no member named 'Exit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|217|error: 'class GameDialog' has no member named 'HighScores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|234|error: no `void GameDialog::Exit()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|234|error: `void GameDialog::Exit()' and `void GameDialog::Exit()' cannot be overloaded| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|240|error: no `void GameDialog::HighScores()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|240|error: `void GameDialog::HighScores()' and `void GameDialog::HighScores()' cannot be overloaded| ||=== Build finished: 11 errors, 0 warnings ===| |
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 |
#ifndef DIALOG_HPP #define DIALOG_HPP class Dialog { public : // Variablen SDL_Event event; // Zum Abfangen der Benutzereingaben SDL_Surface* sScreen; // Screen Surface int width; // Breite des Fensters int height; // Höhe des Fensters int mx; // Mouse Position X int my; // Mouse Position Y int clicked_button; //Wenn ein Button gedrückt wurde, kriegt clicked_button einen Wert, der nach der Unend.Schleife abgefragt wird // Methoden zum Benutzen void apply_surface(int x,int y,SDL_Surface* source,SDL_Surface* destination); // Zeichnet ein Bild an die Koordinaten bool containsPoint(SDL_Rect r,int x, int y); // Prüft ob Punkt in Rectangle enthalten ist // Methoden die Überschrieben werden sollten aber jeder Dialog enthalten sollte void init(); // Öffnet das Fenster und prepariert den Dialog void loadData(); // Ladet alle Bilder void drawDialog(); // Zeichnet alle Bilder und Buttons bool checkClicks(); // Prüft welcher Button gedrückt wurde und führt entsprechendes aus } #endif |
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 |
/* * All the Code is written by Kevin Riehl alias Developer_X * Copyright 2011 */ #include "Dialog.hpp" void Dialog::apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination) { //Holds offsets SDL_Rect offset; //Get offsets offset.x = x; offset.y = y; //Blit SDL_BlitSurface( source, NULL, destination, &offset ); } bool Dialog::containsPoint(SDL_Rect r, int x, int y) { if(x<r.x|| x>r.x+r.w) return false; if(y<r.y|| y>r.y+r.h) return false; return true; } |
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 |
#ifndef GAMEDIALOG_H_INCLUDED #define GAMEDIALOG_H_INCLUDED #include "Dialog.hpp" #include "SDL/SDL.h" #include "SDL/SDL_image.h" #include "SDL/SDL_ttf.h" #include "SDL/SDL_mixer.h" class GameDialog : public Dialog { public : GameDialog(); ~GameDialog(); SDL_Surface* sText; // Text : - X Games 2011 - SDL_Surface* sTitle; // Title : The Frog Game SDL_Surface* sFrog; // Bild des Frosches SDL_Surface* sBackgroundImage; // Images der unselektierten Buttons SDL_Surface* sPlay; SDL_Surface* sOptions; SDL_Surface* sExit; SDL_Surface* sHighscores; SDL_Surface* sSPlay; // Images der selektierten Buttons SDL_Surface* sSOptions; SDL_Surface* sSExit; SDL_Surface* sSHighscores; SDL_Rect rPlay; // Rectangles der Buttons SDL_Rect rOptions; SDL_Rect rExit; SDL_Rect rHighscores; Mix_Chunk *button1; // Click Sounds Mix_Chunk *button2; Mix_Chunk *jump; void Play(); // Spielen void Options(); // Optionen void Exit(); // Beenden void HighScores(); // Highscores }; #endif |
C-/C++-Quelltext |
|
1 2 3 4 |
void GameDialog::HighScores() { // ... } |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|100|error: no `void GameDialog::init()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|140|error: no `void GameDialog::loadData()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|160|error: no `void GameDialog::drawDialog()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|191|error: no `bool GameDialog::checkClicks()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp||In member function `bool GameDialog::checkClicks()':| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|210|error: 'class GameDialog' has no member named 'Exit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|217|error: 'class GameDialog' has no member named 'HighScores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|234|error: no `void GameDialog::Exit()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|234|error: `void GameDialog::Exit()' and `void GameDialog::Exit()' cannot be overloaded| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|240|error: no `void GameDialog::HighScores()' member function declared in class `GameDialog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|240|error: `void GameDialog::HighScores()' and `void GameDialog::HighScores()' cannot be overloaded| ||=== Build finished: 10 errors, 0 warnings ===| |
C-/C++-Quelltext |
|
1 2 3 4 |
GameDialog::init() { //... } |
Quellcode |
|
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 |
F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp||In member function `void Dialog::init()':| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|118|error: `rPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|123|error: `rOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|128|error: `rExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|133|error: `rHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp||In member function `void Dialog::loadData()':| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|141|error: `sBackgroundImage' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|142|error: `sPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|143|error: `sOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|144|error: `sExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|145|error: `sHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|146|error: `sText' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|147|error: `sTitle' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|148|error: `sSPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|149|error: `sSOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|150|error: `sSExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|151|error: `sSHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|152|error: `sFrog' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|154|error: `button1' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|155|error: `button2' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|156|error: `jump' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|141|warning: unused variable 'sBackgroundImage'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|142|warning: unused variable 'sPlay'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|143|warning: unused variable 'sOptions'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|144|warning: unused variable 'sExit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|145|warning: unused variable 'sHighscores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|146|warning: unused variable 'sText'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|147|warning: unused variable 'sTitle'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|148|warning: unused variable 'sSPlay'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|149|warning: unused variable 'sSOptions'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|150|warning: unused variable 'sSExit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|151|warning: unused variable 'sSHighscores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|152|warning: unused variable 'sFrog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|154|warning: unused variable 'button1'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|155|warning: unused variable 'button2'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|156|warning: unused variable 'jump'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp||In member function `void Dialog::drawDialog()':| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|161|error: `sBackgroundImage' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|162|error: `sText' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|163|error: `sTitle' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|165|error: `sFrog' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|167|error: `rPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|168|error: `sSPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|168|warning: unused variable 'sSPlay'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|170|error: `sPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|170|warning: unused variable 'sPlay'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|167|warning: unused variable 'rPlay'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|172|error: `rOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|173|error: `sSOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|173|warning: unused variable 'sSOptions'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|175|error: `sOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|175|warning: unused variable 'sOptions'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|172|warning: unused variable 'rOptions'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|177|error: `rExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|178|error: `sSExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|178|warning: unused variable 'sSExit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|180|error: `sExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|180|warning: unused variable 'sExit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|177|warning: unused variable 'rExit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|182|error: `rHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|183|error: `sSHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|183|warning: unused variable 'sSHighscores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|185|error: `sHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|185|warning: unused variable 'sHighscores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|182|warning: unused variable 'rHighscores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|161|warning: unused variable 'sBackgroundImage'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|162|warning: unused variable 'sText'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|163|warning: unused variable 'sTitle'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|165|warning: unused variable 'sFrog'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp||In member function `bool Dialog::checkClicks()':| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|192|error: `rPlay' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|194|error: `button1' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|196|error: `Play' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|194|warning: unused variable 'button1'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|196|warning: unused variable 'Play'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|192|warning: unused variable 'rPlay'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|199|error: `rOptions' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|201|error: `button2' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|203|error: `Options' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|201|warning: unused variable 'button2'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|203|warning: unused variable 'Options'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|199|warning: unused variable 'rOptions'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|206|error: `rExit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|208|error: `jump' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|210|error: `Exit' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|210|warning: unused variable 'Exit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|206|warning: unused variable 'rExit'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|213|error: `rHighscores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|215|error: `button1' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|217|error: `HighScores' was not declared in this scope| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|215|warning: unused variable 'button1'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|217|warning: unused variable 'HighScores'| F:\C++ Projekte\Games\The Frog Game\GameDialog.cpp|213|warning: unused variable 'rHighscores'| ||=== Build finished: 47 errors, 42 warnings ===| |
Werbeanzeige