|
@@ -1,3 +1,12 @@
|
|
|
+/********************************************************************
|
|
|
+ * Nomes: Gabriel Capella Números USP: 8962078
|
|
|
+ * João Herique Luciano 8535957
|
|
|
+ *
|
|
|
+ * Tarefa: RedCore - EP2 MAC0463
|
|
|
+ * Arquivo: BeginScene.cpp
|
|
|
+ * Descrição: Classe para tela inicial do jogo.
|
|
|
+ ********************************************************************/
|
|
|
+
|
|
|
#include "BeginScene.h"
|
|
|
#include "GameScene.h"
|
|
|
#include "SimpleAudioEngine.h"
|
|
@@ -34,8 +43,7 @@ Scene* BeginScene::createScene() {
|
|
|
}
|
|
|
|
|
|
bool BeginScene::init() {
|
|
|
- //////////////////////////////
|
|
|
- // 1. super init first
|
|
|
+
|
|
|
if (!Layer::init()) {
|
|
|
return false;
|
|
|
}
|
|
@@ -47,7 +55,7 @@ bool BeginScene::init() {
|
|
|
auto bg = cocos2d::LayerColor::create(COLOR_back);
|
|
|
this->addChild(bg);
|
|
|
|
|
|
- auto menu_item_start = MenuItemFont::create(MSG_START, CC_CALLBACK_1(BeginScene::Play, this));
|
|
|
+ auto menu_item_start = MenuItemFont::create(MSG_START, CC_CALLBACK_0(BeginScene::Play, this));
|
|
|
menu_item_start->setFontNameObj(FONT);
|
|
|
|
|
|
menu_item_start->setPosition(Point(visibleSize.width / 2, (visibleSize.height*0.25)));
|
|
@@ -95,7 +103,7 @@ bool BeginScene::init() {
|
|
|
userdata->setDoubleForKey("time", last);
|
|
|
userdata->setIntegerForKey("level", level);
|
|
|
|
|
|
- this->levels = level;
|
|
|
+ this->level_game = level;
|
|
|
|
|
|
char level_text[256];
|
|
|
if (level != 0) {
|
|
@@ -109,8 +117,8 @@ bool BeginScene::init() {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-void BeginScene::Play(cocos2d::Ref *pSender) {
|
|
|
- auto scene = GameScene::createScene(this->levels);
|
|
|
+void BeginScene::Play() {
|
|
|
+ auto scene = GameScene::createScene(this->level_game);
|
|
|
Director::getInstance()->replaceScene(scene);
|
|
|
}
|
|
|
|