Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-02-2010, 03:21 PM   #22 (permalink)
iPhoneDevelopment
Banned
 
Join Date: Dec 2009
Posts: 61
Default

I have read close to 30 different tutorials now, but have got barely any further than where I was before, so I have come back to the place where I have got the best info from in the past....

I am, yet again, having some problems:

1) I have set up a variable to prevent my character from falling until the first swipe has been detected:
Code:
@interface: BOOL firstSwipe
@property (nonatomic, assign) BOOL firstSwipe;


- (void)viewDidLoad {
 firstSwipe = false; }

-(void)moveBlocks {
	
	if(gameState == kGameStateRunning) {
		
		if (firstSwipe = true) {
			character.transform = CGAffineTransformTranslate(character.transform, 0.0, 15.0); }

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
	
	if(gameState == kGameStateRunning) {
	
	UITouch *touch = [touches anyObject];
	CGPoint currentTouchPosition = [touch locationInView:self.view];
	
		if (fabsf(startTouchPosition.x - currentTouchPosition.x) >= HORIZ_SWIPE_DRAG_MAX &&
			fabsf(startTouchPosition.y - currentTouchPosition.y) <= VERT_SWIPE_DRAG_MIN)
		{
	if (currentTouchPosition.y > startTouchPosition.y) {
		[self characterJump];
		firstSwipe = true; } }
But my character falls whether the first swipe has happened or not!

2) How do I make the the blocks continue to fall when they reach the bottom of the screen or each other (instead of just stop) to simulate that the screen is moving (I tried changing the
Code:
if (newCenter.y > 420 || [self isTouchingStoppedBlock:block]) {
				
				if (stoppedBlocks==nil){
					stoppedBlocks = [[NSMutableArray alloc] init];
				}
				
				newCenter.y = newCenter.y -10;
to newCenter.y -5 but it didn't do anything)?

The only thing I have done successfully is to make the character jump!

Thanks for all your help

Cam
iPhoneDevelopment is offline   Reply With Quote
 

» Advertisements
» Online Users: 365
21 members and 344 guests
ADY, bobli, Dani77, Duncan C, ghost, HDshot, HemiMG, ilmman, MarcoAlmeida, MarkC, Meoz, ngaikwad, Punkjumper, Raffaello, Robiwan, Rudy, themathminister, timle8n1, wilky94
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,223
Posts: 380,728
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:46 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.