Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

version 1.0.3

Release of Fedia Engine 0.1
  • Loading branch information...
commit 801f435d721c62855014ac9b52e8577ee7f32482 1 parent 4822a15
@calex22 authored
Showing with 140 additions and 82 deletions.
  1. +2 −0  Fedia/Fedia.vcxproj
  2. +6 −0 Fedia/Fedia.vcxproj.filters
  3. +16 −77 Fedia/fedia/fediaMain.cpp
  4. +3 −2 Fedia/fedia/fediaMain.h
  5. +38 −0 Fedia/fedia/fediaMap.cpp
  6. BIN  Fedia/fedia/grass.bmp
  7. +34 −0 Fedia/fediaCommand.cpp
  8. +39 −0 Fedia/fediaLog.cpp
  9. 0  Fedia/fediaLog.h
  10. BIN  Fedia/fonts/FreeMono.ttf
  11. BIN  Fedia/fonts/FreeMonoBold.ttf
  12. BIN  Fedia/fonts/FreeMonoBoldOblique.ttf
  13. BIN  Fedia/fonts/FreeMonoOblique.ttf
  14. BIN  Fedia/fonts/FreeSans.ttf
  15. BIN  Fedia/fonts/FreeSansBold.ttf
  16. BIN  Fedia/fonts/FreeSansBoldOblique.ttf
  17. BIN  Fedia/fonts/FreeSansOblique.ttf
  18. BIN  Fedia/fonts/FreeSerif.ttf
  19. BIN  Fedia/fonts/FreeSerifBold.ttf
  20. BIN  Fedia/fonts/FreeSerifBoldItalic.ttf
  21. BIN  Fedia/fonts/FreeSerifItalic.ttf
  22. BIN  Fedia/graphic/down1.bmp
  23. BIN  Fedia/graphic/down2.bmp
  24. BIN  Fedia/graphic/down3.bmp
  25. BIN  Fedia/graphic/graphic_1.png
  26. BIN  Fedia/graphic/grass.bmp
  27. BIN  Fedia/graphic/interface.bmp
  28. BIN  Fedia/graphic/left1.bmp
  29. BIN  Fedia/graphic/left2.bmp
  30. BIN  Fedia/graphic/left3.bmp
  31. BIN  Fedia/graphic/ls.bmp
  32. BIN  Fedia/graphic/right1.bmp
  33. BIN  Fedia/graphic/right2.bmp
  34. BIN  Fedia/graphic/right3.bmp
  35. BIN  Fedia/graphic/sign.bmp
  36. BIN  Fedia/graphic/splash.bmp
  37. BIN  Fedia/graphic/sti.bmp
  38. BIN  Fedia/graphic/sti2.bmp
  39. BIN  Fedia/graphic/sti3.bmp
  40. BIN  Fedia/graphic/sti4.bmp
  41. BIN  Fedia/graphic/sti5.bmp
  42. BIN  Fedia/graphic/sti6.bmp
  43. BIN  Fedia/graphic/sti7.bmp
  44. BIN  Fedia/graphic/up1.bmp
  45. BIN  Fedia/graphic/up2.bmp
  46. BIN  Fedia/graphic/up3.bmp
  47. BIN  Fedia/graphic/vand.bmp
  48. BIN  Fedia/graphic/ws.bmp
  49. BIN  Fedia/quest/skilt.bmp
  50. BIN  Fedia/quest/skilt1.bmp
  51. BIN  Fedia/quest/skilt10.bmp
  52. BIN  Fedia/quest/skilt11.bmp
  53. BIN  Fedia/quest/skilt12.bmp
  54. BIN  Fedia/quest/skilt13.bmp
  55. BIN  Fedia/quest/skilt14.bmp
  56. BIN  Fedia/quest/skilt15.bmp
  57. BIN  Fedia/quest/skilt16.bmp
  58. BIN  Fedia/quest/skilt17.bmp
  59. BIN  Fedia/quest/skilt18.bmp
  60. BIN  Fedia/quest/skilt19.bmp
  61. BIN  Fedia/quest/skilt2.bmp
  62. BIN  Fedia/quest/skilt20.bmp
  63. BIN  Fedia/quest/skilt21.bmp
  64. BIN  Fedia/quest/skilt22.bmp
  65. BIN  Fedia/quest/skilt23.bmp
  66. BIN  Fedia/quest/skilt24.bmp
  67. BIN  Fedia/quest/skilt25.bmp
  68. BIN  Fedia/quest/skilt26.bmp
  69. BIN  Fedia/quest/skilt27.bmp
  70. BIN  Fedia/quest/skilt28.bmp
  71. BIN  Fedia/quest/skilt29.bmp
  72. BIN  Fedia/quest/skilt3.bmp
  73. BIN  Fedia/quest/skilt30.bmp
  74. BIN  Fedia/quest/skilt31.bmp
  75. BIN  Fedia/quest/skilt32.bmp
  76. BIN  Fedia/quest/skilt33.bmp
  77. BIN  Fedia/quest/skilt34.bmp
  78. BIN  Fedia/quest/skilt35.bmp
  79. BIN  Fedia/quest/skilt36.bmp
  80. BIN  Fedia/quest/skilt37.bmp
  81. BIN  Fedia/quest/skilt38.bmp
  82. BIN  Fedia/quest/skilt39.bmp
  83. BIN  Fedia/quest/skilt4.bmp
  84. BIN  Fedia/quest/skilt40.bmp
  85. BIN  Fedia/quest/skilt41.bmp
  86. BIN  Fedia/quest/skilt42.bmp
  87. BIN  Fedia/quest/skilt43.bmp
  88. BIN  Fedia/quest/skilt44.bmp
  89. BIN  Fedia/quest/skilt45.bmp
  90. BIN  Fedia/quest/skilt46.bmp
  91. BIN  Fedia/quest/skilt47.bmp
  92. BIN  Fedia/quest/skilt48.bmp
  93. BIN  Fedia/quest/skilt49.bmp
  94. BIN  Fedia/quest/skilt5.bmp
  95. BIN  Fedia/quest/skilt50.bmp
  96. BIN  Fedia/quest/skilt6.bmp
  97. BIN  Fedia/quest/skilt7.bmp
  98. BIN  Fedia/quest/skilt8.bmp
  99. BIN  Fedia/quest/skilt9.bmp
  100. +0 −3  Trash run.sln
  101. +2 −0  Trash run/game.h
View
2  Fedia/Fedia.vcxproj
@@ -67,8 +67,10 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
+ <ClCompile Include="fediaLog.cpp" />
<ClCompile Include="fediaPlayer.cpp" />
<ClCompile Include="fedia\fediaMain.cpp" />
+ <ClCompile Include="fedia\fediaMap.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
View
6 Fedia/Fedia.vcxproj.filters
@@ -30,6 +30,12 @@
<ClCompile Include="fediaPlayer.cpp">
<Filter>Fedia</Filter>
</ClCompile>
+ <ClCompile Include="fediaLog.cpp">
+ <Filter>Fedia</Filter>
+ </ClCompile>
+ <ClCompile Include="fedia\fediaMap.cpp">
+ <Filter>Fedia</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="fedia\fediaMain.h">
View
93 Fedia/fedia/fediaMain.cpp
@@ -8,7 +8,7 @@ Fedia Engine - Main
////////////////////////////////////////////////////////////////////////////////////////
//Globale variabler m.m.
const double FediaVersion = 0.1; // Version of the Engine
-const bool FediaLogFile = false; // Log should be in a file?
+
const char fediaGameName[] = "FediaEngineTest"; // Game name
const int maxFPS = 60; // Max FPS for game
int fediaMain::mode = 1;
@@ -29,9 +29,6 @@ SDL_Rect button3;
SDL_Rect button4;
SDL_Rect button5;
////////////////////////////////////////////////////////////////////////////////////////
-// Map
-SDL_Rect mapObject[2050];
-////////////////////////////////////////////////////////////////////////////////////////
// Test Function etc.
SDL_Rect temp;
////////////////////////////////////////////////////////////////////////////////////////
@@ -121,6 +118,10 @@ void fediaCommand()
player.playerLevel = newlevel;
cout << "SpillerLevel er nu: " << newlevel << endl;
}
+ else if(command == "help")
+ {
+ cout << "info - viser Engine info" << endl << "playerinfo - viser playerinfo + stats" << endl << "changelevel [LVL] - ændre level" << endl;
+ }
else
{
@@ -165,39 +166,7 @@ fediaMain::fediaMain(int resW = 1980, int resH = 1080, bool fullscreen = true, b
}
-void fediaMain::fediaLog(bool success, string text) // Log func
-{
- if(success == 1)
- {
- if(FediaLogFile == false)
- {
- cout << "Fedia--> " << text << endl;
- }
- else if(FediaLogFile == true)
- {
- // SKRIV TIL LOKAL LOG FIL...
- }
- else
- {
- cout << "Fedia--> Log ERROR(1)" << endl;
- }
- }
- else
- {
- if(FediaLogFile == false)
- {
- cout << "Fedia--> " << text << " <-- kunne ikke lade sig gøre" << endl;
- }
- else if(FediaLogFile == true)
- {
- // SKRIV TIL LOKAL LOG FIL...
- }
- else
- {
- cout << "Fedia--> Log ERROR(1)" << endl;
- }
- }
-}
+
double fediaMain::getFediaVersion() // returns version of engine
{
return FediaVersion;
@@ -224,34 +193,34 @@ void fediaMain::fediaInitialization() // Main loop of the game.
SDL_Event event;
while(SDL_PollEvent(&event))
{
-
- switch(event.type)
- {
- case SDL_QUIT:
- running = false;
+
+ switch(event.type)
+ {
+ case SDL_QUIT:
+ running = false;
break;
case SDL_MOUSEBUTTONDOWN:
mouseX = event.button.x;
mouseY = event.button.y;
if(mouseX>button1.x && mouseX<button1.x+button1.w && mouseY>button1.y && mouseY<button1.y+button1.h && event.button.button==SDL_BUTTON_LEFT){
- cout << "KNAP 1\n";
+ fediaLog(1, "pressed button 1");
mode = 2;
}
else if(mouseX>button2.x && mouseX<button2.x+button2.w && mouseY>button2.y && mouseY<button2.y+button2.h && event.button.button==SDL_BUTTON_LEFT)
{
- cout << "KNAP 2\n";
+ fediaLog(1, "pressed button 2");
}
else if(mouseX>button3.x && mouseX<button3.x+button3.w && mouseY>button3.y && mouseY<button3.y+button3.h && event.button.button==SDL_BUTTON_LEFT)
{
- cout << "KNAP 3\n";
+ fediaLog(1, "pressed button 3");
}
else if(mouseX>button4.x && mouseX<button4.x+button4.w && mouseY>button4.y && mouseY<button4.y+button4.h && event.button.button==SDL_BUTTON_LEFT)
{
- cout << "KNAP 4\n";
+ fediaLog(1, "pressed button 4");
}
else if(mouseX>button5.x && mouseX<button5.x+button5.w && mouseY>button5.y && mouseY<button5.y+button5.h && event.button.button==SDL_BUTTON_LEFT)
{
- cout << "KNAP 5\n";
+ fediaLog(1, "pressed button 5");
break;
}
break;
@@ -315,33 +284,3 @@ void fediaMain::fediaInitialization() // Main loop of the game.
}
-void fediaMain::createmap()
-{
- /*
- Fedia Map
- */
- int rgColor = 0;
- int a, b;
- int x, y;
- int count = 0, count1 = 0;
- for (a = 0; a <= 34; a++)
- {
- for ( b = 0; b <= 60; b++)
- {
- x = b * 32;
- mapObject[count].x = x;
- mapObject[count].y = a * 32;
- mapObject[count].w = 32;
- mapObject[count].h = 32;
- for(count1 =0; count1 <= 2060; count1++)
- {
- SDL_FillRect(screen , &mapObject[count1] , SDL_MapRGB(screen->format , rgColor , rgColor , 20 ) ); // LAVER SPILLER!
- }
- count = count + 1;
- }
- }
-
-
- mode = 3;
-//SDL_FreeSurface(image);
-}
View
5 Fedia/fedia/fediaMain.h
@@ -21,11 +21,12 @@ class fediaMain
private:
// SDL
- SDL_Surface* screen, *image;
+ SDL_Surface* screen, *image, *map;
+ TTF_Font *font;
fediaPlayer player;
int static mode;
// Functions
- double getFediaVersion(); // Retyrn version - (double)
+ double getFediaVersion(); // Return version - (double)
void fediaLog(bool success, string text); // Success(true/false) - text Tekst med besked
void fediaMovePlayer();
void fediaSetPlayer();
View
38 Fedia/fedia/fediaMap.cpp
@@ -0,0 +1,38 @@
+#include "fediaMain.h"
+// Map
+SDL_Rect mapObject[2050];
+////////////////////////////////////////////////////////////////////////////////////////
+void fediaMain::createmap()
+{
+ /*
+ Fedia Map
+ */
+ map = IMG_Load("grass.png");
+ int rgColor = 0;
+ int a, b;
+ int x, y;
+ int count = 0, count1 = 0;
+ for (a = 0; a <= 34; a++)
+ {
+ for ( b = 0; b <= 15; b++)
+ {
+ x = b * 32;
+ mapObject[count].x = x;
+ mapObject[count].y = a * 32;
+ mapObject[count].w = 32;
+ mapObject[count].h = 32;
+ for(count1 =0; count1 <= 2060; count1++)
+ {
+ //SDL_FillRect(screen , &mapObject[count1] , SDL_MapRGB(screen->format , rgColor , rgColor , 20 ) ); // LAVER SPILLER! - Det jo løgnt!
+ // SDL_BlitSurface(map, NULL, screen, &mapObject[count1]); // Laver background
+ cout << count1 << endl;
+ // SDL_FreeSurface(map);
+ }
+ count = count + 1;
+ }
+ }
+
+
+ mode = 3;
+//SDL_FreeSurface(image);
+}
View
BIN  Fedia/fedia/grass.bmp
Binary file not shown
View
34 Fedia/fediaCommand.cpp
@@ -0,0 +1,34 @@
+#include "fedia\fediaMain.h"
+const double FediaVersion = 0.1; // Version of the Engine
+void fediaCommand()
+{
+ fediaPlayer player(NULL);
+ while(1)
+ {
+ string command;
+ cout << "Fedia CML --> ";
+ cin >> command;
+ cout << endl;
+ if(command == "info")
+ {
+ cout << "Fedia Engine version: " << FediaVersion << endl;
+ cout << "by Alex Martensen 2012" << endl;
+ }
+ else if(command == "playerinfo")
+ {
+ cout << "HP: " << player.playerHp << " Mana: " << player.playerMana << endl << "Level: " << player.playerLevel << " XP: " << player.playerXp << endl << "X: " << playerObject.x << " Y: " << playerObject.y << endl;
+ }
+ else if(command == "changelevel")
+ {
+ cout << "Indtast nyt level.: ";
+ int newlevel; // NEW LEVEL
+ cin >> newlevel;
+ player.playerLevel = newlevel;
+ cout << "SpillerLevel er nu: " << newlevel << endl;
+ }
+ else
+ {
+
+ }
+ }
+}
View
39 Fedia/fediaLog.cpp
@@ -0,0 +1,39 @@
+#include "fedia\fediaMain.h"
+
+///////////////////////////////////////////////////////////////////////////
+const bool FediaLogFile = false; // Log should be in a file?
+///////////////////////////////////////////////////////////////////////////
+
+void fediaMain::fediaLog(bool success, string text) // Log func
+{
+ if(success == 1)
+ {
+ if(FediaLogFile == false)
+ {
+ cout << "Fedia--> " << text << endl;
+ }
+ else if(FediaLogFile == true)
+ {
+ // SKRIV TIL LOKAL LOG FIL...
+ }
+ else
+ {
+ cout << "Fedia--> Log ERROR(1)" << endl;
+ }
+ }
+ else
+ {
+ if(FediaLogFile == false)
+ {
+ cout << "Fedia--> " << text << " <-- kunne ikke lade sig gøre" << endl;
+ }
+ else if(FediaLogFile == true)
+ {
+ // SKRIV TIL LOKAL LOG FIL...
+ }
+ else
+ {
+ cout << "Fedia--> Log ERROR(1)" << endl;
+ }
+ }
+}
View
0  Fedia/fediaLog.h
No changes.
View
BIN  Fedia/fonts/FreeMono.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeMonoBold.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeMonoBoldOblique.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeMonoOblique.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSans.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSansBold.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSansBoldOblique.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSansOblique.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSerif.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSerifBold.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSerifBoldItalic.ttf
Binary file not shown
View
BIN  Fedia/fonts/FreeSerifItalic.ttf
Binary file not shown
View
BIN  Fedia/graphic/down1.bmp
Binary file not shown
View
BIN  Fedia/graphic/down2.bmp
Binary file not shown
View
BIN  Fedia/graphic/down3.bmp
Binary file not shown
View
BIN  Fedia/graphic/graphic_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  Fedia/graphic/grass.bmp
Binary file not shown
View
BIN  Fedia/graphic/interface.bmp
Binary file not shown
View
BIN  Fedia/graphic/left1.bmp
Binary file not shown
View
BIN  Fedia/graphic/left2.bmp
Binary file not shown
View
BIN  Fedia/graphic/left3.bmp
Binary file not shown
View
BIN  Fedia/graphic/ls.bmp
Binary file not shown
View
BIN  Fedia/graphic/right1.bmp
Binary file not shown
View
BIN  Fedia/graphic/right2.bmp
Binary file not shown
View
BIN  Fedia/graphic/right3.bmp
Binary file not shown
View
BIN  Fedia/graphic/sign.bmp
Binary file not shown
View
BIN  Fedia/graphic/splash.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti2.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti3.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti4.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti5.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti6.bmp
Binary file not shown
View
BIN  Fedia/graphic/sti7.bmp
Binary file not shown
View
BIN  Fedia/graphic/up1.bmp
Binary file not shown
View
BIN  Fedia/graphic/up2.bmp
Binary file not shown
View
BIN  Fedia/graphic/up3.bmp
Binary file not shown
View
BIN  Fedia/graphic/vand.bmp
Binary file not shown
View
BIN  Fedia/graphic/ws.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt1.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt10.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt11.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt12.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt13.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt14.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt15.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt16.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt17.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt18.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt19.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt2.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt20.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt21.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt22.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt23.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt24.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt25.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt26.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt27.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt28.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt29.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt3.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt30.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt31.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt32.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt33.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt34.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt35.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt36.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt37.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt38.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt39.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt4.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt40.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt41.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt42.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt43.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt44.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt45.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt46.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt47.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt48.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt49.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt5.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt50.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt6.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt7.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt8.bmp
Binary file not shown
View
BIN  Fedia/quest/skilt9.bmp
Binary file not shown
View
3  Trash run.sln
@@ -34,7 +34,4 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(Performance) = preSolution
- HasPerformanceSessions = true
- EndGlobalSection
EndGlobal
View
2  Trash run/game.h
@@ -7,8 +7,10 @@
#include <vector>
#include <cstdlib>
#include <SDL.h>
+
#include "map.h"
#include <time.h>
+
#include <SDL_ttf.h>
using namespace std;
Please sign in to comment.
Something went wrong with that request. Please try again.