Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Running Processes With the Main Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dragon20942




PostPosted: Fri Jan 21, 2011 9:42 pm   Post subject: Running Processes With the Main Program

Turing:

procedure shipHitProc
    for j : 0 .. howManyEnemies
        for k : 0 .. 19
            if hitbox (1) >= waves (i).enemyBulletsX (j).enemyBulletsX (k) and hitbox (1) <= (waves (i).enemyBulletsX (j).enemyBulletsX (k) + ((75 - (waves (i).enemyBulletCenteringPixelX (j) +
                    37)) * 2))
                    or hitbox (3) >= waves (i).enemyBulletsX (j).enemyBulletsX (k) and hitbox (3) <= (waves (i).enemyBulletsX (j).enemyBulletsX (k) + ((75
                    - (waves (i).enemyBulletCenteringPixelX (j) + 37)) * 2))
                    or hitbox (1) <= waves (i).enemyBulletsX (j).enemyBulletsX (k) and hitbox (3) >= (waves (i).enemyBulletsX (j).enemyBulletsX (k) + ((75
                    - (waves (i).enemyBulletCenteringPixelX (j) + 37)) * 2)) then

                if hitbox (2) >= waves (i).enemyBulletsY (j).enemyBulletsY (k) and hitbox (2) <= (waves (i).enemyBulletsY (j).enemyBulletsY (k) + (waves (i).enemyBulletCenteringPixelY (j)
                        * (-1)))
                        or hitbox (4) >= waves (i).enemyBulletsY (j).enemyBulletsY (k) and hitbox (4) <= (waves (i).enemyBulletsY (j).enemyBulletsY (k)
                        + (waves (i).enemyBulletCenteringPixelY (j) * (-1)))
                        or hitbox (2) <= waves (i).enemyBulletsY (j).enemyBulletsY (k) and hitbox (4) >= (waves (i).enemyBulletsY (j).enemyBulletsY (k)
                        + (waves (i).enemyBulletCenteringPixelY (j) * (-1))) then
                    ifHit := true
                end if
            end if
        end for
    end for
    for j : 0 .. howManyEnemies
        for k : 0 .. 19
            if hitbox2 (1) >= waves (i).enemyBulletsX (j).enemyBulletsX (k) and hitbox2 (1) <= (waves (i).enemyBulletsX (j).enemyBulletsX (k) + ((75 - (waves (i).enemyBulletCenteringPixelX (j) +
                    37)) * 2))
                    or hitbox2 (3) >= waves (i).enemyBulletsX (j).enemyBulletsX (k) and hitbox2 (3) <= (waves (i).enemyBulletsX (j).enemyBulletsX (k) + ((75
                    - (waves (i).enemyBulletCenteringPixelX (j) + 37)) * 2))
                    or hitbox2 (1) <= waves (i).enemyBulletsX (j).enemyBulletsX (k) and hitbox2 (3) >= (waves (i).enemyBulletsX (j).enemyBulletsX (k) + ((75
                    - (waves (i).enemyBulletCenteringPixelX (j) + 37)) * 2)) then

                if hitbox2 (2) >= waves (i).enemyBulletsY (j).enemyBulletsY (k) and hitbox2 (2) <= (waves (i).enemyBulletsY (j).enemyBulletsY (k) + (waves (i).enemyBulletCenteringPixelY (j)
                        * (-1)))
                        or hitbox2 (4) >= waves (i).enemyBulletsY (j).enemyBulletsY (k) and hitbox2 (4) <= (waves (i).enemyBulletsY (j).enemyBulletsY (k)
                        + (waves (i).enemyBulletCenteringPixelY (j) * (-1)))
                        or hitbox2 (2) <= waves (i).enemyBulletsY (j).enemyBulletsY (k) and hitbox2 (4) >= (waves (i).enemyBulletsY (j).enemyBulletsY (k)
                        + (waves (i).enemyBulletCenteringPixelY (j) * (-1))) then
                    ifHit := true
                end if
            end if
        end for
    end for

    if ifHit = true then
        lives -= 1
        shipStyle := shipHit
        %resume main program
       delay (1000)
       shipStyle := shipRegular
    end if
end shipHitProc


ignore the big, fancy, inefficient if statments and focus on the shipStyles. Could I run this procedure, and after a certain point, run the main program with it? I want to use the delay to keep shipStyle as shipHit WHILE THE PROGRAM IS RUNNING before changing it back to shipRegular.
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri Jan 21, 2011 10:00 pm   Post subject: RE:Running Processes With the Main Program

Use a counter. after X frames/seconds since last, change the image back to normal.
RandomLetters




PostPosted: Fri Jan 21, 2011 10:03 pm   Post subject: RE:Running Processes With the Main Program

I do not believe it is possible.

You can however, try the Time.Elapsed function.
Dragon20942




PostPosted: Fri Jan 21, 2011 10:09 pm   Post subject: RE:Running Processes With the Main Program

How would I do since X seconds?
Insectoid




PostPosted: Fri Jan 21, 2011 10:31 pm   Post subject: RE:Running Processes With the Main Program

Time.DelaySinceLast().
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: