Posts

Mein Verständnis von der Sozialdemokratie

Die Sozialdemokratie entstand, als sich eine neue Bevölkerungsschicht, das Industrieproletariat, formierte. Diese Menschen waren berufstätig, verdienten aber gerade einmal so viel Geld, dass es zum Leben reichte, und kein Vermögen. Weiters gab es eine große Masse an Arbeitslosen, die in Armut lebten, und einige wenige Privilegierte, die viel Geld hatten und nicht arbeiten mussten. Dazu kam die Landbevölkerung, die einst Leibeigene gewesen waren. Inzwischen gab es Bauern, die eigenes Land besaßen, und Knechte, die ähnlich wie das Industrieproletariat nichts besaßen. Das Ideal der Sozialdemokratie war eine Gesellschaft, in der jeder arbeitet. Jeder sollte so leben wie das Industrieproletariat. So nobel es sein mochte, dass man auf diese Weise die Armut bekämpfen musste, so sehr verabscheue ich den Neid und den Hass auf die privilegierte Schicht, der man ihre Privilegien entziehen wollte. Ich will, dass man so viel verdient, dass man jeden Monat ein bisschen Geld zur Seite legen und auf d

Intellect as the sixth sense

Reading the blog of Ed Close I had the idea that we perceive our thoughts, dreams and ideas just like the input from our five senses, so our intellect is our sixth sense. This is in accordance with Jungian theory which postulates that intuition is the sixth sense. However, intuition should be more properly named intellect. 80% of the population primarily relies on their five physical senses, while 20% prefers to use intellect.

Day 6 of the Level Editor project

I decided that I would make the level scrollable today, so that tiles could be placed outside the first screen. In game.h, we define two new variables unsigned int currentPosX; unsigned int currentPosY; which we set to zero in the Initialize method. These variables will store the current position in the world, where x,y = 0,0 is the bottom-left corner. We need to consider this position whenever we work with coordinates of tiles. So in the Update method, we have to write: case Solid: newElement->coordX0 += currentPosX; newElement->coordX1 += currentPosX; newElement->coordY0 += currentPosY; newElement->coordY1 += currentPosY; level.push_back(newElement); break; and evaluate the keypresses: if (g_keys->keyDown[VK_UP]) { currentPosY++; } if (g_keys->keyDown[VK_DOWN]) { if (currentPosY > 0) currentPosY--; } if (g_keys->keyDown[VK_LEFT]) { if (currentPosX > 0) currentPosX--; } if (g_keys->

Day 5 of the Level Editor project

I've decided that today we will implement a delete functionality. If levelEditorDrawMode is set to Delete, the user shall have the power to draw a rectangle and as a consequence all objects that are completely within the boundaries of this rectangle will be removed from the level. To the Update method, we have to add code that checks for the keypresses: If the user presses '0', Delete mode shall be activated, if he/she presses '1', Solid drawing mode. if (g_keys->keyDown['0']) { keyPressed->keyDown['0'] = true; } else if (keyPressed->keyDown['0'] && !g_keys->keyDown['0']) { levelEditorDrawMode = Delete; keyPressed->keyDown['0'] = false; } if (g_keys->keyDown['1']) { keyPressed->keyDown['1'] = true; } else if (keyPressed->keyDown['1'] && !g_keys->keyDown['1']) { levelEditorDrawMode = Solid; keyPressed->keyDown[&

Day 4 of the Level Editor project

Today we want to introduce saving and loading to our project. In game.h, we introduce these new variables: unsigned int levelSizeX; unsigned int levelSizeY; Keys *keyPressed; keyPressed stores keys that have been detected as pressed, so that we can perform an action as soon as the key is released. In the Initialize method of game.cpp, we initialize keyPressed:   keyPressed = new Keys(); Now we have to append the following code to the Update method so that the action is performed once the respective key is released: if (g_keys->keyDown['S']) { keyPressed->keyDown['S'] = true; } else if (keyPressed->keyDown['S'] && !g_keys->keyDown['S']) { SaveLevel(); keyPressed->keyDown['S'] = false; } if (g_keys->keyDown['L']) { keyPressed->keyDown['L'] = true; } else if (keyPressed->keyDown['L'] && !g_keys->keyDown['L']) { LoadLevel(); keyPre

Day 3 of the Level Editor project

Yesterday I wrote that today's objective would be to make the input more user-friendly, so that's exactly what I did. Instead of dragging and dropping the rectangle, the user now has to click once, then when he/she moves the mouse a rectangular shape will be shown, and as soon as he/she clicks again the rectangle will be drawn and stored in the level data. In order to achieve this I defined two new variables in game.h: LevelDrawElement* newElement; bool newElementActive; I set newElementActive = false; in Initialize and I modified Update and Draw as follows: void Game::Update_LevelEditor(DWORD tickCount, DWORD lastTickCount) { GlobalStatics globalStatics; if (g_mouse->buttonPressed != mouse->buttonPressed) { if (g_mouse->buttonPressed) { if (!newElementActive) { newElement = new LevelDrawElement(); newElement->type = levelEditorDrawMode; newElement->coordX0 = g_mouse->coordX; newElement->coordY0 = globalStatics.wo

Day 2 of the Level Editor project

We need to poll the mouse, so we define a new class: #ifndef _MOUSE_H_ #define _MOUSE_H_ class Mouse { public: BOOL buttonPressed; unsigned int coordX; unsigned int coordY; }; #endif In the class GL_Window we create a new variable Mouse *mouse; that references to this class. In our Initialize method of class Game, we write g_mouse = window->mouse; so that we can reference to the mouse data by means of g_mouse in analogy to g_keys. To the Window method, we add the following lines: case WM_LBUTTONDOWN: window->mouse->buttonPressed = true; window->mouse->coordX = GET_X_LPARAM(lParam); window->mouse->coordY = GET_Y_LPARAM(lParam); break; case WM_LBUTTONUP: window->mouse->buttonPressed = false; window->mouse->coordX = GET_X_LPARAM(lParam); window->mouse->coordY = GET_Y_LPARAM(lParam); break; Then we also need a new data structure for keeping up with the level details: class LevelDrawElement { public: LevelE