-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBlock.m
64 lines (53 loc) · 1.29 KB
/
Block.m
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
//
// Block.m
// iPhoneSOY
//
// Created by Matas Empakeris on 3/1/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "Block.h"
@implementation Block
@synthesize blockColor;
-(id)initWithColorStyle:(Color)color
{
if( self = [super init] )
{
if( color == BLUE )
{
self.blockColor = BLUE;
[self initWithFile: @"Block_BLUE_iPhone.png"];
} //end else if
else if( color == GREEN )
{
self.blockColor = GREEN;
[self initWithFile: @"Block_GREEN_iPhone.png"];
} //end else if
else if( color == RED )
{
self.blockColor = RED;
[self initWithFile: @"Block_RED_iPhone.png"];
} //end else if
else if( color == GOLD )
{
self.blockColor = GOLD;
[self initWithFile: @"Block_CYBERCOIN_iPhone.png"];
} //end else if
} //end if
return self;
} //end initWithColor
-(int)xPosition:(int)column
{
return 20 + ( column * X_PADDING );
} //end xPosition
-(int)yPosition:(int)row initialRow:(BOOL)initBar
{
if( !initBar )
{
return 80 + ( row * 25 );
} //end if
else
{
return INIT_ROW;
} //end else
} //end yPosition
@end