setParallax

I have written the following code then also I’m not able to view any output on the emulator . Im using ndkr7b , emulator is 2.1 version

File: Cocos2dxSimpleGame.java
package org.cocos2dx.Cocos2dxSimpleGame;
import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.widget.EditText;

public class Cocos2dxSimpleGame extends Cocos2dxActivity{
private Cocos2dxGLSurfaceView mGLView;
// private GLSurfaceView mGLView;
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);

// get the packageName,it’s used to set the resource path
String packageName = getApplication().getPackageName();
super.setPackageName(packageName);

/*mGLView = new Cocos2dxGLSurfaceView(this);
setContentView(mGLView);/
/*setContentView;
mGLView = findViewById;
mGLView.setTextFieldfindViewById);
/
}

`Override
protected void onPause() {
super.onPause();
mGLView.onPause();
}

 `Override

protected void onResume() {
super.onResume();
mGLView.onResume();
}

static {
System.loadLibrary(“cocos2d”);
System.loadLibrary(“box2d”);
System.loadLibrary(“cocosdenshion”);
System.loadLibrary(“game_logic”);
System.loadLibrary(“game”);
}
}

File: HelloWorldScene.h
#ifndef HELLO_WORLD_H
#define HELLO_WORLD_H

// When you import this file, you import all the cocos2d classes
#include “cocos2d.h”
#include “Box2D.h”
//#include “LevelHelperLoader.h”
#include “CCparallaxNode.h”

#define kGameSpeedNormal 30
#define kGameSpeedFast
40
#define kGameSpeedUltraFast ~~50

class HelloWorld : public cocos2d::CCLayer {
public:
~HelloWorld;
HelloWorld;
// returns a Scene that contains the HelloWorld as the only child
static cocos2d::CCScene* scene;
// adds a new sprite at a given coordinate
void addNewSpriteWithCoords;
virtual void draw;
//virtual bool init;
virtual void ccTouchesEnded;
void tick;
void updateParallax;
void setParallax;
private:
b2World* world;
};
#endif // HELLO_WORLD_H
File:HelloWorldScene.cpp
//Imported the .h files
HelloWorld::HelloWorld
{
setIsTouchEnabled;
//setIsAccelerometerEnabled;
// LevelHelperLoader* loader;
/*CCSprite **layer1,**layer2,**layer3,**layer4,**layer1_b,**layer2_b,**layer3_b,**layer4_b;
CCParallaxNode *backgroundNode,**foregroundNode;/
//b2World* world;
CCSize screenSize = CCDirector::sharedDirector~~>getWinSize;
//UXLOG;
// Define the gravity vector.
b2Vec2 gravity;
gravity.Set;
// Do we want to let bodies sleep?
bool doSleep = true;
// Construct a world object, which will hold and simulate the rigid bodies.
world = new b2World;
world~~>SetAllowSleeping;
world~~>SetContinuousPhysics(true);

/*
m_debugDraw = new GLESDebugDraw( PTM_RATIO );
world~~>SetDebugDraw;
uint flags = 0;
flags = b2DebugDraw::e_shapeBit;
flags
= b2DebugDraw::e_jointBit;
flags = b2DebugDraw::e_aabbBit;
flags
= b2DebugDraw::e_pairBit;
flags += b2DebugDraw::e_centerOfMassBit;
m_debugDraw~~>SetFlags(flags);
/
b2BodyDef groundBodyDef;
groundBodyDef.position.Set; // bottom-left corner
// Call the body factory which allocates memory for the ground body
// from a pool and creates the ground box shape .
// The body is also added to the world.
b2Body
groundBody = world~~>CreateBody;
// Define the ground box shape.
b2PolygonShape groundBox;
// bottom
groundBox.SetAsBox, 0);
groundBody~~>CreateFixture(&groundBox, 0);

// top
groundBox.SetAsBox(screenSize.width/2/PTM_RATIO, 0, b2Vec2(0, screenSize.height/2/PTM_RATIO), 0);
groundBody~~>CreateFixture;
// left
groundBox.SetAsBox, 0);
groundBody~~>CreateFixture(&groundBox, 0);

// right
groundBox.SetAsBox(0, screenSize.height/2/PTM_RATIO, b2Vec2(screenSize.width/2/PTM_RATIO, 0), 0);
groundBody~~>CreateFixture;

//Set up sprite
CCSpriteBatchNode mgr = CCSpriteBatchNode::batchNodeWithFile;
addChild;
addNewSpriteWithCoords );
CCLabelTTF
label = CCLabelTTF::labelWithString;
addChild;
label~~>setColor( ccc3(0,0,255) );
label~~>setPosition );
schedule );

CCSpriteFrameCache::sharedSpriteFrameCache~~>addSpriteFramesWithFile;
CCSprite **layer1,**layer2,**layer3,**layer4,**layer1_b,**layer2_b,**layer3_b,**layer4_b;
CCParallaxNode **backgroundNode,*foregroundNode;
// addSpriteFramesWithFile:`“SandParallax.plist”];
// CCSprite
bgImage = CCSprite::spriteWithSpriteFrameName(“level-backdrop1.png”);
setParallax();
schedule( schedule_selector(HelloWorld::updateParallax) );

}
void HelloWorld::setParallax(){

/*CCSprite *layer1,*layer2,*layer3,*layer4,*layer1_b,*layer2_b,*layer3_b,*layer4_b;
CCParallaxNode *_backgroundNode,*_foregroundNode;*/
layer1 = CCSprite::spriteWithSpriteFrameName("Sand_Layer_01");
layer2 = CCSprite::spriteWithSpriteFrameName("Sand_Layer_02");
layer3 = CCSprite::spriteWithSpriteFrameName("Sand_Layer_03");
layer4 = CCSprite::spriteWithSpriteFrameName("Sand_Layer_04");


layer1_b = CCSprite::spriteWithSpriteFrameName("Sand_Layer_01");
layer2_b = CCSprite::spriteWithSpriteFrameName("Sand_Layer_02");
layer3_b = CCSprite::spriteWithSpriteFrameName("Sand_Layer_03");
layer4_b = CCSprite::spriteWithSpriteFrameName("Sand_Layer_04");



_backgroundNode=CCParallaxNode::node();
this->addChild(_backgroundNode,0);


_foregroundNode=CCParallaxNode::node();//[CCParallaxNode node];
this->addChild(_foregroundNode,2);
// [self addChild:_foregroundNode z:10];
CCPoint L1Speed = ccp( 1, 1);
CCPoint L2Speed = ccp( 2, 2);
CCPoint L3Speed = ccp( 3, 3);
CCPoint L4Speed = ccp( 4, 4);

CCSize winsize=CCDirector::sharedDirector()->getWinSize();//[[CCDirector sharedDirector] winSize];

{
    _backgroundNode->addChild(layer1, 1, L1Speed, ccp(  layer1->getContentSize().width/2  ,layer1->getContentSize().height/2));
    _backgroundNode->addChild(layer2, 2, L2Speed, ccp(  layer2->getContentSize().width/2  ,layer2->getContentSize().height/2));
    _backgroundNode->addChild(layer3, 3, L3Speed, ccp(  layer3->getContentSize().width/2  ,layer3->getContentSize().height/2));
    _foregroundNode->addChild(layer4, 4, L4Speed, ccp(  layer4->getContentSize().width/2  ,layer4->getContentSize().height/2));



    _backgroundNode->addChild(layer1_b, 1, L1Speed, ccp(  layer1_b->getContentSize().width/2  ,layer1_b->getContentSize().height/2));
    _backgroundNode->addChild(layer2_b, 2, L2Speed, ccp(  layer2_b->getContentSize().width/2  ,layer2_b->getContentSize().height/2));
    _backgroundNode->addChild(layer3_b, 3, L3Speed, ccp(  layer3_b->getContentSize().width/2  ,layer3_b->getContentSize().height/2));
    _foregroundNode->addChild(layer4_b, 4, L4Speed, ccp(  layer4_b->getContentSize().width/2  ,layer4_b->getContentSize().height/2));


}


//NSLog(`“%f”,.size.width);

}
void HelloWorld::updateParallax{
CCPoint backgroundScrollVel=ccp;
_backgroundNode~~>setPosition, ccpMult));

*foregroundNode~~>setPosition, ccpMult));

CCArray **sp1Array=CCArray::arrayWithCapacity;
sp1Array~~>addObject;
sp1Array~~>addObject;
sp1Array~~>addObject;

for {

if sp1Array~~>objectAtIndex)>getPosition).x<sp1Array>objectAtIndex)>getContentSize).width/2)
{
*backgroundNode~~>incrementOffsetsp1Array~~>objectAtIndex)>getContentSize).width,0 ), sp1Array>objectAtIndex)) ;
}
}
CCArray **sp2Array=CCArray::arrayWithCapacity;
sp2Array~~>addObject;
sp2Array~~>addObject;
sp2Array~~>addObject;

for {
;
if sp2Array~~>objectAtIndex)>getPosition).x
<sp2Array>objectAtIndex)
>getContentSize).width/2)
{
_backgroundNode~~>incrementOffsetsp2Array~~>objectAtIndex)>getContentSize).width,0 ), sp2Array>objectAtIndex)) ;

}
}

CCArray**sp3Array=CCArray::arrayWithCapacity;
sp3Array~~>addObject;
for {
;
if sp3Array~~>objectAtIndex)>getPosition).x
<sp3Array
>objectAtIndex)>getContentSize).width/2)
// .x <sp.contentSize.width/2)
{
*foregroundNode
>incrementOffsetsp3Array
>objectAtIndex)>getContentSize).width,0 ), sp3Array>objectAtIndex)) ;
// ;
}
}

CCArray**sp4Array=CCArray::arrayWithCapacity;
sp4Array~~>addObject;
for {
;
if sp4Array~~>objectAtIndex)>getPosition).x
<sp4Array
>objectAtIndex)>getContentSize).width/2)
{
*foregroundNode
>incrementOffset(ccp(2*(((CCSprite *)sp4Array~~>objectAtIndex)~~>getContentSize()).width,0 ), ((CCSprite *)sp4Array->objectAtIndex(i))) ;

}
}
}