摘要:
import mathclass Point: def move(self, x, y): self.x = x self.y = y def reset(self): self.move(0, 0) def calculate_dista... 阅读全文
摘要:
1. 不可变字符串Objective-C:NSString *string1 = @"Hello World!";Swift:let string1 = "Hello world!"2. 可变字符串Objective-C:NSMutableString *string2 = [NSMutableSt... 阅读全文
摘要:
1. MutabilityObjective-C offers several classes in both “regular” and mutable versions,such as NSString/NSMutableString, NSArray/NSMutableArray, and s... 阅读全文
摘要:
1. 首先,声明一个2个大小的sprite数组class GameScreen : public cocos2d::Layer{public: ... cocos2d::Sprite *backgroundSpriteArray[2];};2. 完成初始化,1张图片用于当前显示,另1张用... 阅读全文
摘要:
Scene* MainMenu::createScene(){ // 'scene' is an autorelease object auto scene = Scene::create(); // 'layer' is an autorelease object ... 阅读全文
摘要:
iOS:This is done using XCode project details (select the requiredorientation) Android:AndroidManifest.xml (android:screenOrientation=portrait) 阅读全文
摘要:
// create vector with elements from 1 to 6 in arbitrary order vector coll = { 2, 5, 4, 1, 6, 3 }; // find and print minimum and maximum elements... 阅读全文
摘要:
attributes.pyclass Point: passp1 = Point()p2 = Point()p1.x = 5p1.y = 4p2.x = 3p2.y = 6print(p1.x, p1.y)print(p2.x, p2.y)first_method.pyclass Point:... 阅读全文