Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Whoohoo. Funktioniert. Client und Server sind getrennt.
Noch zu tun: och gibt es kein richtiges Handshake, so dass Aufloesung, ersion, etc von Client und Server beim Starten uebereinstimmen muss. Der Server benoetigt im Moment noch libSDL (wegen SDL_GetTicks und SDL_Delay) Der Server sollte auf 20 FPS begrenzt werden um die Paketanzahl niedrig zu halten Die Position der Kreaturen sollte nicht direkt uebertragen werden, sondern nur das anzulaufende Ziel und die Geschwindigkeit. Der Client sollte daraus eine glatte Bewegung erzeugen. Testen, sehr viel Testen :) git-svn-id: http://infon.googlecode.com/svn/trunk@14 8171fb75-e542-0410-96e4-03d5dd800671
- Loading branch information
Showing
24 changed files
with
530 additions
and
1,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,58 @@ | |||
/* | |||
Copyright (c) 2006 Florian Wesch <fw@dividuum.de>. All Rights Reserved. | |||
This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; either version 2 of the License, or | |||
(at your option) any later version. | |||
This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | |||
You should have received a copy of the GNU General Public License along | |||
with this program; if not, write to the Free Software Foundation, Inc., | |||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |||
*/ | |||
|
|||
#ifndef COMMON_CREATURE_H | |||
#define COMMON_CREATURE_H | |||
|
|||
#define MAXCREATURES 256 | |||
|
|||
#define CREATURE_COLORS 16 | |||
#define CREATURE_TYPES 4 | |||
#define CREATURE_DIRECTIONS 32 | |||
#define CREATURE_ANIMS 2 | |||
|
|||
#define CREATURE_STATES 8 | |||
|
|||
#define CREATURE_NETWORK_RESOLUTION 16 | |||
|
|||
typedef enum { | |||
CREATURE_IDLE, | |||
CREATURE_WALK, | |||
CREATURE_HEAL, | |||
CREATURE_EAT, | |||
CREATURE_ATTACK, | |||
CREATURE_CONVERT, | |||
CREATURE_SPAWN, | |||
CREATURE_FEED, | |||
} creature_state; | |||
|
|||
#define CREATURE_DIRTY_ALIVE (1 << 0) | |||
#define CREATURE_DIRTY_POS (1 << 1) | |||
#define CREATURE_DIRTY_TYPE (1 << 2) | |||
#define CREATURE_DIRTY_FOOD (1 << 3) | |||
#define CREATURE_DIRTY_HEALTH (1 << 4) | |||
#define CREATURE_DIRTY_STATE (1 << 5) | |||
#define CREATURE_DIRTY_TARGET (1 << 6) | |||
#define CREATURE_DIRTY_MESSAGE (1 << 7) | |||
|
|||
#define CREATURE_DIRTY_ALL 0xFF | |||
#define CREATURE_DIRTY_NONE 0x00 | |||
|
|||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.