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

Username:   Password: 
 RegisterRegister   
 shooting help
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2, 3
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: Mon May 09, 2011 5:45 pm   Post subject: Re: shooting help

Turing:

for i : 1 .. 48 by 1
    if isBulletAlive (j) = true and bulletsX (j) >= enemiesX (i) + 5 and (bulletsX (j) <= enemiesX (i) + 45) and
            (bulletsY (j) >= enemiesY (i)) and (bulletsY (j) <= enemiesY (i) + 50) or bulletsY (j) >= maxy then
        isBulletAlive (j) := false
        enemiesY (i) := -100
        score := score + 10
    end if
end for

You have the checking for enemies AND the checking to see if the bullet is higher than maxy in the same line. I can't quite find the reason it's screwing up, but the infinite money glitch is most definitely in there.
Sponsor
Sponsor
Sponsor
sponsor
mnorman




PostPosted: Tue May 10, 2011 8:15 am   Post subject: RE:shooting help

ya your right, i seperated the maxy and it works better but now the enemies dont always die
Raknarg




PostPosted: Tue May 10, 2011 6:14 pm   Post subject: RE:shooting help

hmm... do your enemies die separately on your new code? I tried your recent code and they all die if one is hit.
mnorman




PostPosted: Wed May 11, 2011 10:22 am   Post subject: RE:shooting help

ya they do, do you want the new code, all i did was put the maxy line in a seperate elsif line
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 3 of 3  [ 34 Posts ]
Goto page Previous  1, 2, 3
Jump to:   


Style:  
Search: