-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJouster.h
104 lines (80 loc) · 2.46 KB
/
Jouster.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//
// Jouster.h
// FingerJoust
//
// Created by Hunter Francis on 7/11/13.
// Copyright 2013 Hunter Francis. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "cocos2d.h"
#define JOUSTER_BODY_MAXSPEED 500
@class CCWarpSprite, Player, GameLayer;
@interface Jouster : CCSprite {
Player *player;
GameLayer *gameLayer;
CCWarpSprite *jousterSprite;
CCWarpSprite *jousterInnerSprite;
CCWarpSprite *bodyOuterSprite;
CCWarpSprite *bodyInnerSprite;
CGPoint previousVelocity;
CGPoint velocity;
CGPoint outsideVelocity;
CGPoint joustVelocity;
CGPoint joustOutsideVelocity;
BOOL waitingForTouch;
CGPoint previousTouch;
float bodyRadius;
float joustRadius;
float orbitalOffset;
float aliveTicker;
CGPoint joustPosition;
int wins;
BOOL isDead;
//powerStones collected
int powerStones;
//supermode
BOOL isSuperMode;
float superModeTimer;
//stun stuff
BOOL isStunned;
float stunTimer;
float maxSpeed;
CCParticleSystemQuad *stunParticles;
CCParticleSystemQuad *motionStreak;
CCParticleSystemQuad *jousterMotionStreak;
CGPoint touchPoint;
BOOL isJousterInactive;
float jousterInactiveTimer;
}
@property BOOL isJousterInactive;
@property float jousterInactiveTimer;
@property BOOL isDisplay;
@property int powerStones;
@property int wins;
@property float bodyRadius, joustRadius, orbitalOffset;
@property BOOL waitingForTouch, isDead;
@property CGPoint velocity, joustPosition;
@property CGPoint joustVelocity, outsideVelocity;
@property (nonatomic, assign) GameLayer *gameLayer;
@property (nonatomic, assign) Player *player;
@property (nonatomic, retain) CCParticleSystemQuad *motionStreak, *jousterMotionStreak;
@property (nonatomic, assign) CCWarpSprite *jousterSprite;
@property (nonatomic, assign) CCWarpSprite *bodyInnerSprite;
@property CGPoint joustOutsideVelocity;
-(id) initWithPlayer:(Player *) p;
-(void) makeTail;
-(void) setWorldPositionOfJoust:(CGPoint) pos;
-(CGPoint) getWorldPositionOfJoust;
-(void) resetJouster;
-(void) update:(ccTime)dt;
-(void) engageSuperMode;
-(void) disengateSuperMode;
-(void) stunBody;
-(void) checkJoustBoundaries;
-(void) calculateJoustPosition:(ccTime) dt;
-(void) joustCollision:(CGPoint) joustPos withRadius:(float) radius;
-(void) resetTouch;
-(void) touch:(CGPoint) touch;
-(BOOL) doesTouchDeltaMakeSense:(CGPoint) touch;
-(void) checkBoundaries;
@end