cleaning
[exterlulz-kokomonds.git] / src / Gem.h
blobf0229b0d3b7a076898c44ab6dcd8d3d85355b31c
1 /* ----====----====----====----====----====----====----====----====----====----
2 Gem.h (jeweltoy)
4 JewelToy is a simple game played against the clock.
5 Copyright (C) 2001 Giles Williams
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 ----====----====----====----====----====----====----====----====----====---- */
22 /* kokomonds is a fork of JewelToy.
23 * repository: http://github.com/exterlulz/kokomonds
26 // TODO: clean
28 #import <Cocoa/Cocoa.h>
30 // TODO: move to .m?
31 // TODO: replace with enum?
32 #define GEMSTATE_RESTING 1
33 #define GEMSTATE_FADING 2
34 #define GEMSTATE_FALLING 3
35 #define GEMSTATE_SHAKING 4
36 #define GEMSTATE_ERUPTING 5
37 #define GEMSTATE_MOVING 6
39 // MW...
40 #define GEMSTATE_SHIVERING 7
42 #define FADE_STEPS 8.0
43 #define GRAVITY 1.46
44 #define GEM_ERUPT_DELAY 45
46 // Open GL Z value for gems
47 #define GEM_SPRITE_Z -0.25
49 @class OpenGLSprite;
51 @interface Gem : NSObject
53 int gemType;
54 NSImage *image;
56 OpenGLSprite *sprite;
58 NSSound *tink;
59 NSSound *sploink;
61 // MW
62 int waitForFall;
64 int state;
65 int animationCounter;
66 double vx, vy;
68 NSPoint _positionOnBoard;
69 NSPoint _positionOnScreen;
72 @property int state;
73 @property int animationCounter;
75 @property NSPoint _positionOnBoard;
76 @property NSPoint _positionOnScreen;
78 - (id)init;
79 - (void)dealloc;
81 + (Gem *)gemWithNumber:(int)d andImage:(NSImage *)img;
82 + (Gem *)gemWithNumber:(int)d andSprite:(OpenGLSprite *)aSprite;
84 - (int)animate;
85 - (void)fade;
86 - (void)fall;
87 - (void)shake;
88 - (void)erupt;
90 // MW...
91 - (void)shiver;
93 - (int)gemType;
94 - (void)setGemType:(int)d;
96 - (NSImage *)image;
97 - (void)setImage:(NSImage *)value;
98 - (void)drawImage;
100 - (OpenGLSprite *)sprite;
101 - (void)setSprite:(OpenGLSprite *)value;
102 - (void)drawSprite;
104 - (void)setVelocity:(int)valx :(int)valy :(int)steps;
106 - (void)setSoundsTink:(NSSound *)tinkSound Sploink:(NSSound *)sploinkSound;
108 @end