Search Results

Search found 5 results on 1 pages for 'nar'.

Page 1/1 | 1 

  • Change collision action

    - by PatrickR
    I have a collision detection and its working fine, the problem is, that whenever my "bird" is hitting a "cloud", the cloud dissapers and i get some points. The same happens for the "sol" which it should, but not with the clouds. How can this be changed ? ive tryed a lot, but can seem to figger it out. Collision Code - (void)update:(ccTime)dt { bird.position = ccpAdd(bird.position, skyVelocity); NSMutableArray *projectilesToDelete = [[NSMutableArray alloc] init]; for (CCSprite *bird in _projectiles) { bird.anchorPoint = ccp(0, 0); CGRect absoluteBox = CGRectMake(bird.position.x, bird.position.y, [bird boundingBox].size.width, [bird boundingBox].size.height); NSMutableArray *targetsToDelete = [[NSMutableArray alloc] init]; for (CCSprite *cloudSprite in _targets) { cloudSprite.anchorPoint = ccp(0, 0); CGRect absoluteBox = CGRectMake(cloudSprite.position.x, cloudSprite.position.y, [cloudSprite boundingBox].size.width, [cloudSprite boundingBox].size.height); if (CGRectIntersectsRect([bird boundingBox], [cloudSprite boundingBox])) { [targetsToDelete addObject:cloudSprite]; } } for (CCSprite *solSprite in _targets) { solSprite.anchorPoint = ccp(0, 0); CGRect absoluteBox = CGRectMake(solSprite.position.x, solSprite.position.y, [solSprite boundingBox].size.width, [solSprite boundingBox].size.height); if (CGRectIntersectsRect([bird boundingBox], [solSprite boundingBox])) { [targetsToDelete addObject:solSprite]; score += 50/2; [scoreLabel setString:[NSString stringWithFormat:@"%d", score]]; } } // NÅR SKYEN BLIVER RAMT AF FUGLEN for (CCSprite *cloudSprite in targetsToDelete) { //[_targets removeObject:cloudSprite]; //[self removeChild:cloudSprite cleanup:YES]; } // NÅR SOLEN BLIVER RAMT AF FUGLEN for (CCSprite *solSprite in targetsToDelete) { [_targets removeObject:solSprite]; [self removeChild:solSprite cleanup:YES]; } if (targetsToDelete.count > 0) { [projectilesToDelete addObject:bird]; } [targetsToDelete release]; } // NÅR FUGLEN BLIVER RAMT AF ALT ANDET for (CCSprite *bird in projectilesToDelete) { //[_projectiles removeObject:bird]; //[self removeChild:bird cleanup:YES]; } [projectilesToDelete release]; }

    Read the article

  • How to uninstall AMD Display Driver from other install of Windows

    - by nar
    So my Windows 7 had a BSOD from an Ati driver file then restarting only gives me some wierd coloured lines at the top of the screen. Starting in safe mode causes the boot up to freeze at AtiPcie.sys and overlays the same coloured lines on the safe mode start up display. It seems to be a problem with the display driver but I can't get into the OS at all to uninstall it. Luckily I have an old install of Windows 7 from when I moved to a SSD still on my HDD and that runs just fine so I'm pretty sure its a software problem (Maybe the SSD corrupted a driver file or something). So does anyone know how I can uninstall the driver files from another Windows 7 install on the same PC? EDIT: What I mean is, I'm running on the broken PC right now but using a different HDD's windows install. I have full access to the not booting up OS drive with the Windows so I can delete any files/load the registry etc...

    Read the article

  • apache url / filename with special characters

    - by Mario Delgado
    I have this url: http://domain.com/wp-content/uploads/2012/10/Hvilke-vilkår-følger-med-når-du-bestiller-nyt-bredbånd.png If I ftp/ssh or just browse to that folder (apache index feature), I see the file Hvilke-vilkår-følger-med-når-du-bestiller-nyt-bredbånd.png If I click on the link from the apache index, I can see the file, however, if I copy the URL and try to browse to it directly, I get the error: The requested URL /wp-content/uploads/2012/10/Hvilke-vilkÃ¥r-følger-med-nÃ¥r-du-bestiller-nyt-bredbÃ¥nd.png was not found on this server. Also my error log says: File does not exist: /wp-content/uploads/2012/10/Hvilke-vilk\xc3\xa5r-f\xc3\xb8lger-med-n\xc3\xa5r-du-bestiller-nyt-bredb\xc3\xa5nd.png

    Read the article

  • Write to file depending on minSdkVersion - android

    - by Simon Rosenqvist
    Hi, I have written a filewriter for my android application. It is to function on a Galaxy Tab, so my minSdkVersion has to be at least 4, so it will fill the screen. I originally started out with SdkVersion = 2 and at that point my filewriter worked perfectly. Changing the SdkVersion to 4 introduced the problem. My filewriter doesn't work anymore! The application runs fine, but a file doesn't get created. My .java file looks like this: public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(R.layout.main); //definerer en knap kaldet button1 og sætter en listener på denne. Button button1 = (Button)findViewById(R.id.btnClickMe); button1.setOnClickListener(btnListener); //definerer en knap kaldet button2 og sætter en listener på denne. Button button2 = (Button)findViewById(R.id.btnClickMe2); button2.setOnClickListener(btnListener2); } //en variabel af typen 'long' deklæres og kaldes tid1. public long time1; private OnClickListener btnListener = new OnClickListener() { public void onClick(View v) { //Når der klikkes på button1 gemmes et tal i variablen tid1. time1 = System.currentTimeMillis(); } }; //en variabel af typen 'long' deklæres og kaldes tid2. public long time2; // en variabel af typen 'string' deklæres og kaldes tid: public String string1 = "time:"; private OnClickListener btnListener2 = new OnClickListener() { public void onClick(View v) { //Når der klikkes på button2 gemmes et tal i variablen tid2. time2 = System.currentTimeMillis(); // Herefter oprettes en fil kaldet "file.txt". try{ File file = new File(Environment.getExternalStorageDirectory(), "file.txt"); file.createNewFile(); BufferedWriter writer = new BufferedWriter(new FileWriter(file,true)); //string1 og tid2-tid1 skrives til filen. tid2-tid1 giver den tid der går fra der er trykket på den ene knap til den anden i millisekunder. writer.write(string1 + "\t" + (time2-time1)); writer.newLine(); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } }; } And my manifest.xml looks like this: <?xml version="1.0" encoding="utf-8"?> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> Why does my filewriter not work with minSdkVersion 2? Do i have to make a new filewriter? or what to do? Sorry for the messy code, i'm quite new to programming :)

    Read the article

  • Where can we use "This" in Recursion methode...

    - by T_Geek
    Hi . I have a methode in a static class which try to convert bi*nar*y tre to list I'd like to make a recusion but I couldn't I've implemented some opertation in my class like add,delet,find.it's too easy to implement its . Here is the code class ARB { private: struct BT { int data; BT *l; BT *r; }; struct BT *p; public ARB(); ~ARB(); void del(int n); void add(int n); }; void ARB::del(int num) { //The code ,don't care about it }; main() { // BTR T; T.add(3); T.add(5); }; Here is what should we do to transfert the code from Benary tree tolist LLC ARB::changeit() { LLC x; while(this!=NULL) { x.add(this->data); // if(this.l==NULL) { x.print(); //To print the elemnts of List return(x); } else { x=changeit(this.l); } if(this.r!=NULL) { x.~LLC(); x=changeit(this.r); return(x); } } }

    Read the article

1