| objects.h - gnuskii - GNUSki improved for ascii skiing experience. | |
| git clone git://bitreich.org/gnuskii git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws… | |
| Log | |
| Files | |
| Refs | |
| Tags | |
| README | |
| LICENSE | |
| --- | |
| objects.h (1649B) | |
| --- | |
| 1 /* GNUSki - a clone of the old game Skifree where you race downhill | |
| 2 avoiding rocks and trees and try to score points by doing some | |
| 3 tricks. | |
| 4 Copyright (C) 2007 Rudolf Olah | |
| 5 | |
| 6 This program is free software; you can redistribute it and/or modify | |
| 7 it under the terms of the GNU General Public License as published by | |
| 8 the Free Software Foundation; either version 2 of the License, or | |
| 9 (at your option) any later version. | |
| 10 | |
| 11 This program is distributed in the hope that it will be useful, | |
| 12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 GNU General Public License for more details. | |
| 15 | |
| 16 You should have received a copy of the GNU General Public License | |
| 17 along with this program; if not, write to the Free Software | |
| 18 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-130… | |
| 19 */ | |
| 20 | |
| 21 #ifndef OBJECTS_H | |
| 22 #define OBJECTS_H | |
| 23 | |
| 24 #include <stdio.h> | |
| 25 #include <stdlib.h> | |
| 26 #include <ncurses.h> | |
| 27 | |
| 28 enum objectType { none, tree, rock, hill, skier, bigfoot, snowman }; | |
| 29 | |
| 30 struct Object | |
| 31 { | |
| 32 enum objectType type; | |
| 33 int x, y; | |
| 34 float trick; | |
| 35 }; | |
| 36 | |
| 37 struct Object makeObject (enum objectType type, int x, int y); | |
| 38 void setPosition (struct Object* o, int x, int y); | |
| 39 | |
| 40 /* Move the object in a certain facing/direction */ | |
| 41 /* facing is one of the following characters: | |
| 42 1 n 2 | |
| 43 w e | |
| 44 4 s 3 | |
| 45 */ | |
| 46 void moveObject (struct Object* o, char facing, int speed); | |
| 47 | |
| 48 void draw (struct Object o, char facing); | |
| 49 | |
| 50 /* Checks for collision between a player object and a target */ | |
| 51 int collision (struct Object player, struct Object target); | |
| 52 | |
| 53 void setupColors (); | |
| 54 | |
| 55 #endif |