It looks like you're new here. If you want to get involved, click one of these buttons!
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
if((locations2.x >= 1 && locations2.x <= 100) && (locations2.y >= 1 && locations2.y <=80) )
if((locations2.x >= 380 && locations2.x <=480) && (locations2.y >= 1 && locations2.y <=80) )