Computer Science Canada Flag not Executitng |
Author: | Hack.saw [ Sun Jan 21, 2007 6:58 pm ] | ||||
Post subject: | Flag not Executitng | ||||
WeaponSpeed is set to which weapon you are currently using. If you are using a fast weapon (ie. speed of 1.9 or <) this code works perfectly and you attack everytime AttackCD = your cooldown. My problem, and I have no clue why, is if you are using a weapon with a speed > then 1.9 the CD still works and counts down to 0 then resets but you never attack when it = your cooldown ![]() my code to attack is:
If you want full code please ask, I can't figure it out, with fast weapons it goes through everything and attacks but with slow weapons it goes through everything but doesn't attack ![]() |
Author: | Hack.saw [ Sun Jan 21, 2007 8:19 pm ] |
Post subject: | Re: Flag not Executing |
Cervantes, Robert, anyone? It doesnt make any sense to me and I'm handing this in tomorow =/ Sorry if Im being a little impatient but this is a redicules bug and just comes up before I'm almost completely done my game ![]() |
Author: | ericfourfour [ Mon Jan 22, 2007 3:44 pm ] | ||||||
Post subject: | Re: Flag not Executing | ||||||
Hack.saw @ Sun Jan 21, 2007 8:19 pm wrote: I'm handing this in tomorow
Its a good thing no one helped you. I guess you learned your lesson on leaving things to the last minute. Hack.saw wrote: my code to attack is:
This is a massive amount of code for a single if statement. You should try breaking it into separate functions for more readability. Also, instead of writing:
write:
|
Author: | Hack.saw [ Mon Jan 22, 2007 6:55 pm ] |
Post subject: | Re: Flag not Executitng |
![]() ![]() Anyway, Figured out my bug I was rounding the speed it set it to but forgot to round it when i checked for it which ment some of the bigger numbers I added were being rounded up to high. As of your last suggestion I did not even know that "not" was a command in turing, I think I'll just continue on the way I know and was taught. As of the big if statement, if I had to make 4 different statments it would be alot of code I don't need. |
Author: | CodeMonkey2000 [ Tue Jan 23, 2007 4:54 pm ] |
Post subject: | RE:Flag not Executitng |
Hack.saw, That is flaming, Ericourfour has much more experience with programming and is more knoledgeable than you. This is not how you thank someone for taking the time to help you. |
Author: | ericfourfour [ Tue Jan 23, 2007 7:56 pm ] |
Post subject: | Re: Flag not Executitng |
Hack.saw @ Mon Jan 22, 2007 6:55 pm wrote: ![]() ![]() Sorry Hack.saw, I never thought of that (you just seemed a little desperate with your double post). Hack.saw @ Mon Jan 22, 2007 6:55 pm wrote: I did not even know that "not" was a command in turing, I think I'll just continue on the way I know and was taught. As of the big if statement, if I had to make 4 different statments it would be alot of code I don't need.
This is just a bit of advice: if you practise programming with a closed mind (ie not willing to try new things such as not or functions), it will be very difficult to get better and succeed. If you are not willing to accept criticism from others, then why ask for help? |
Author: | Hack.saw [ Tue Jan 23, 2007 10:55 pm ] |
Post subject: | Re: RE:Flag not Executitng |
spearmonkey2000 @ Tue Jan 23, 2007 4:54 pm wrote: Hack.saw, That is flaming, Ericourfour has much more experience with programming and is more knoledgeable than you. This is not how you thank someone for taking the time to help you.
He didnt really help me... Quote: Its a good thing no one helped you. I guess you learned your lesson on leaving things to the last minute
^was the line I was talking about.^ Quote: you just seemed a little desperate with your double post
Hehe, I was very desperate and angry at the time. Believe me I started this game a good week before we stared our project along with another game but I decided this one was more complex and would be worth more. To have a bug like that pop up 2 hours before I had to go to bed then in the morning hand it in was deffinatley not fun. Quote: This is just a bit of advice: if you practise programming with a closed mind (ie not willing to try new things such as not or functions), it will be very difficult to get better and succeed. If you are not willing to accept criticism from others, then why ask for help?
Didn't say at all I wasn't accepting critism, nor did I mention that the code you put was most likely better than what I use. I was taught to use booleans with if true or false and just tpye things by habbit. Keep in mind I have switched from (x:=x+1) to (x+=1) along with many other things from this site and probably would and will use that in the future. You have to understand that someone saying, Im glad you didnt get help, didnt exaclty make me feel any better when reading what I thought was someone trying to help fix the problem though... |