Skip to content

Instantly share code, notes, and snippets.

@gintsmurans
Created March 22, 2014 08:04
Show Gist options
  • Select an option

  • Save gintsmurans/9702934 to your computer and use it in GitHub Desktop.

Select an option

Save gintsmurans/9702934 to your computer and use it in GitHub Desktop.
Pause physics only in cocos2d v3
//
// GameCCPhysicsNode.h
// RollingCandy
//
// Created by Gints Murans on 21/03/14.
// Copyright (c) 2014 Early Bird. All rights reserved.
//
#import "CCPhysicsNode.h"
@interface GameCCPhysicsNode : CCPhysicsNode
@property (nonatomic, assign, getter = isPhysicsPaused) BOOL physicsPaused;
@end
//
// GameCCPhysicsNode.m
// RollingCandy
//
// Created by Gints Murans on 21/03/14.
// Copyright (c) 2014 Early Bird. All rights reserved.
//
#import "GameCCPhysicsNode.h"
@implementation GameCCPhysicsNode
- (void)fixedUpdate:(CCTime)delta
{
if (_physicsPaused == NO)
{
[super fixedUpdate:delta];
}
}
@end
@werm098

werm098 commented Jan 1, 2015

Copy link
Copy Markdown

Worked perfectly thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment