Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

Really upset with xcode @ cocos2d problem

sgr_81sgr_81 Posts: 31Registered Users
Hello All,

I have an app in the app store. the is a problem with buttons in the app when I download that I cant replicate in the simulator or devices

I have cleaned and rebuild and updated by second time and same result.

The problem is with buttons. I have 6 buttons at bottom of screen. all these buttons are activated by positions in touchEvent:

CGPoint locations, locations2;
NSInteger count = 0;

for( UITouch *touch in touches ) {
CGPoint location = [touch locationInView: [touch view]];
switch (count) {
case 0:
locations = [[CCDirector sharedDirector] convertToGL: location];
break;
case 1:
locations2 = [[CCDirector sharedDirector] convertToGL: location];
break;
default:
break;
count++;
}
}

if((locations.x >= lampara.position.x-extraRango && locations.x <= lampara.position.x+(lampara.contentSize.width/scaleContensize)+extraRango)&&
(locations.y >= lampara.position.y-extraRango && locations.y <= lampara.position.y+lampara.contentSize.height+extraRango)){
if(enUsoLampara == true){
if(noCompra == true){
[self lampDisabled];
cantidadMonedas = cantidadMonedas -preciolampara;
[[NSUserDefaults standardUserDefaults] setInteger:cantidadMonedas forKey:@\"Monedas\"];
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
}else{
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
[self newAlerta];
}
}
}

if((locations.x >= bota.position.x -extraRango && locations.x <= bota.position.x+(bota.contentSize.width/scaleContensize)+extraRango)&&
(locations.y >= bota.position.y -extraRango && locations.y <= bota.position.y+bota.contentSize.height+extraRango)){
if(enUsoBota == true){
if(noCompra == true){
[self botaDisabled];
cantidadMonedas = cantidadMonedas -precioBota;
[[NSUserDefaults standardUserDefaults] setInteger:cantidadMonedas forKey:@\"Monedas\"];
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
}else{
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
[self newAlerta];
}
}
}

if((locations.x >= comida.position.x -extraRango && locations.x <= comida.position.x+(comida.contentSize.width/scaleContensize)+extraRango)&&
(locations.y >= comida.position.y -extraRango && locations.y <= comida.position.y+comida.contentSize.height+extraRango)){
if(enUsoComida == true){
if(noCompra == true){
[self comidaDisabled];
cantidadMonedas = cantidadMonedas -precioComida;
[[NSUserDefaults standardUserDefaults] setInteger:cantidadMonedas forKey:@\"Monedas\"];
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
}else{
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
[self newAlerta];
}
}
}

if((locations.x >= ghost.position.x-extraRango && locations.x <= ghost.position.x+(ghost.contentSize.width/scaleContensize)+extraRango)&&
(locations.y >= ghost.position.y-extraRango && locations.y <= ghost.position.y+ghost.contentSize.height+extraRango)){
if(enUsoGhost == true){
if(noCompra == true){
[self ghostDisabled];
cantidadMonedas = cantidadMonedas -precioGhost;
[[NSUserDefaults standardUserDefaults] setInteger:cantidadMonedas forKey:@\"Monedas\"];
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
}else{
if(![[NSUserDefaults standardUserDefaults] boolForKey:@\"fxDesactivado\"]){
[[SimpleAudioEngine sharedEngine]playEffect:@\"BotonFGC.m4a\"];
}
[self newAlerta];
}
}
}

if((locations.x >= 1 && locations.x <= 100) && (locations.y >= 1 && locations.y <=80) ){
texture2D = [[[CCTexture2D alloc]initWithImage:[UIImage imageNamed:@\"correOn.png\"]]autorelease];
[newImage setTexture: texture2D];
if(superBurro == true){
_hero.minVelocityX = _hero.masVelocidad-2;
}else{
_hero.minVelocityX = _hero.masVelocidad;
}
}

if((locations.x >= 380 && locations.x <=480) && (locations.y >= 0 && locations.y <=80) ){
texturaSalta = [[[CCTexture2D alloc]initWithImage:[UIImage imageNamed:@\"saltoOn.png\"]]autorelease];
[salta setTexture: texturaSalta];
[_hero makeJump];
start = [NSDate timeIntervalSinceReferenceDate];
cuenta= true;
polvo.emissionRate =0;
}

}
........ same for locations2



when you touch on this
if((locations2.x >= 1 && locations2.x <= 100) && (locations2.y >= 1 && locations2.y <=80) )
or this:
if((locations2.x >= 380 && locations2.x <=480) && (locations2.y >= 1 && locations2.y <=80) )
all the others buttons become pressed also.

Just in case you are interested in the name of the app is Border Chase, it is free and you can check my problem... when you collect 25 coins you can purchase the flashlight but when you press the run or jump button the flashlight button is also pressed.

Thanks for your time and hope someone can help me with this strange problem. As I said if I run on the simulator or iphone 2, iphone 3gs, iphone 4 or ipad from xcode all works correctly.
__________________

My Apps:

[IMG]http://www.animactiva.us/DFP/57.png[/IMG] Don´t feed the panda - Don´t let the panda fall from his dr
Sign In or Register to comment.