-
Notifications
You must be signed in to change notification settings - Fork 1
/
PapercutPadViewController.h
73 lines (58 loc) · 2.43 KB
/
PapercutPadViewController.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
//
// PapercutPadViewController.h
// Papercut
//
// Created by Jeff Bumgardner on 9/4/12.
// Copyright (c) 2012 Jeff Bumgardner. All rights reserved.
//
// Main view controller for the simulation. Game loop resides here.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <AVFoundation/AVAudioPlayer.h>
#import <AudioToolbox/AudioServices.h>
#import <mach/mach.h>
#import <mach/mach_time.h>
#import <unistd.h>
#import "Variables.h"
@class Border;
@class Paper;
@class PaperPath;
@class ObjManager;
@class Messenger;
@interface PapercutPadViewController : UIViewController <UIAccelerometerDelegate, UIGestureRecognizerDelegate, AVAudioPlayerDelegate> {
// primary attributes
CGFloat elapsedTime; // amount of elasped time
int debugUpdate;
int frameUpdate;
CGRect infoRect; // for the info button
// debugging attributes
UILabel *deltaLabel; // label for movement deltas
UILabel *objectLabel;
NSString *numObjects;
}
@property (nonatomic, strong) ObjManager *world; // object manager for all images displayed
@property (nonatomic, strong) Messenger *messenger;
@property (nonatomic, retain) NSTimer *mainTimer; // OLD loop timer
@property (nonatomic, retain) CADisplayLink *displayLoop; // main game loop
@property (nonatomic, strong) Paper *touchPiece; // temp Paper object for touch responses
@property (nonatomic, strong) Paper *eachPiece; // temp Paper object for dictionary iteration
@property (assign) CFTimeInterval prevTimestamp;
@property (assign) CGPoint firstTouch; // first spot touched - from touchesBegan
@property (assign) CGPoint lastTouch;
@property (assign) CGFloat accelX;
@property (assign) CGFloat lastScale;
@property (assign) CGFloat currScale;
@property (nonatomic, retain) AVAudioPlayer *audio;
@property (nonatomic, retain) AVAudioPlayer *audio_2;
- (id)initPapercut:(PaperProps[])prp
anim:(PaperPropsAnim[])prpAnim
touch:(PaperPropsTouchspot[])prpTouch
group:(PaperGroups[])prpGroups
random:(PaperRandom[])prpRandom
sound:(PaperPropsSounds[])prpSounds
timer:(PaperWorldTimers[])prpTimers; // custom initialization based on menu selection
- (void)loadPapercut;
- (void)unloadPapercut;
- (void)chimeSwipe:(BOOL)dirLeft leftTouch:(CGFloat)xLeft rightTouch:(CGFloat)xRight;
@end