Computer Science Canada Whatdotcolor |
Author: | Tuxedo [ Tue Jan 04, 2005 9:47 pm ] |
Post subject: | Whatdotcolor |
Why do I get an error? What parameters am I missing? [\code] procedure hit (x1, y1:int) var change:=0 if whatdotcolor (x1, y1)= 3 then put "HITTTTTY" delay (1000) end if end hit [code\] ps...how do you do the code label? I know you probably think I am a lamer but can you help and I plan to stay and contribute to the forums after I develop some skill... ![]() |
Author: | Cervantes [ Tue Jan 04, 2005 9:53 pm ] | ||
Post subject: | |||
Error? There's no error. Maybe you're calling it wrong. as for code tags:
EDIT: no, you're not a lamer for asking questions. We all did at some point. And we all will continue to ask questions for the rest of our lives. |
Author: | Tuxedo [ Tue Jan 04, 2005 9:55 pm ] | ||
Post subject: | |||
O thanks I see the code] things now! This is the full thing but I don't see what is wrong and have tried to compare to different programs but am stumped...It is probably really obvious but I am just starting....
apparently not.... |
Author: | Neo [ Tue Jan 04, 2005 10:13 pm ] |
Post subject: | |
Because you have [code],[code],[/code]. |
Author: | Cervantes [ Tue Jan 04, 2005 10:18 pm ] | ||
Post subject: | |||
Yep, as I suspected. See, when you wrote your procedure, you gave it two parameters. You called those parameters x1 and y1, and they were both integers. Now, when you call the procedure, you aren't passing any parameters to it. You need to do something like this:
Which variable you use is up to you. I feel like I've said this before... ![]() |
Author: | Tuxedo [ Tue Jan 04, 2005 10:26 pm ] |
Post subject: | |
AHHHH!!!...I would give up all 17 of my bits to figure this out!!!! ![]() ![]() Can you please put this in the code where I would need it and I will try to be the best noob to ever cross compsci in the history of compsci! I just can't understand where it goes and what to put... ![]() |
Author: | Cervantes [ Tue Jan 04, 2005 10:33 pm ] | ||||
Post subject: | |||||
Here's the chunk of code that you're going to modify:
change it to this:
and, obviously, fix the variables that you pass to the hit procedure. |
Author: | Tuxedo [ Tue Jan 04, 2005 10:49 pm ] |
Post subject: | |
I am probably really stupid or OOT 3.1.1 don't do what you saying to do...however I still am unable get it to work. ![]() ![]() ***wait I think it works!!!! false alarm... var has no value? |
Author: | Neo [ Wed Jan 05, 2005 9:20 am ] |
Post subject: | |
Tuxedo wrote: ***wait I think it works!!!! false alarm... var has no value? You have to initialize variables before you can use them. So if you set up a variable: var x:int then u must do x=20 or something similar |
Author: | Tuxedo [ Sat Jan 08, 2005 4:20 pm ] |
Post subject: | |
I have probably spent more than 4 hours trying to gte this whatdotcolor to work can anybody please just show me how to put it in my code? can you make it hit a yellow dot on the screen that is all I want and am starting to become really frustrated! I am sure it is really easy once I figure it out but as of now am stumped as to why it will not detect... ![]() The updated code is above ^^^^^ |
Author: | Tuxedo [ Sun Jan 09, 2005 7:00 pm ] |
Post subject: | |
Nobody....I am in dire need please help ![]() I do not mean to be a nuisance but have tried all you have said? It will go into the program but not detect? Am I drwing in the wrong place? |
Author: | Cervantes [ Sun Jan 09, 2005 7:27 pm ] | ||
Post subject: | |||
I don't really know what you are asking for, so I wrote this. Hopefully it will answer your question.
|
Author: | Tuxedo [ Sun Jan 09, 2005 7:41 pm ] |
Post subject: | |
I really appreciate your help but I am unable to use that type of code. I will just have to leave out whatdotcolor and take a bad mark and try to figure this thing out when I am under no pressure and at my leisure. Thankyou Cervantes and Neo ![]() Neo you can have +4 bits all I have... ![]() unless you can change that code to using crappy old turing...the one with the blck screen like DOS. No update or (key.up)...etc. Would help me alot ![]() |
Author: | Tuxedo [ Sun Jan 09, 2005 8:20 pm ] |
Post subject: | |
I have managed to gte whatdotcolro to work!!! However when I do it one time it....scratch that!!! edit: I now have it working as whatdotcolor I have fixed the problem through changing something else when you fire twice without shooting in a different direction your gun overheats...I may change that to move in a different direction. W/e... I am stumped on where to put the object in the code that I will hit? Do I need to put them in before the cls and after the cls in the moves? Or am I thinking the wrong way? |
Author: | Cervantes [ Sun Jan 09, 2005 10:00 pm ] |
Post subject: | |
Oww, that's a lot of code. You got the wrong slash in the [/code] ![]() I'm still not really grasping the idea of your program. I'm kind of confused as to why the yellow circle disappears and reappears based on when you move. Also, I would highly recommend using Input.KeyDown instead of getch. There's a tutorial here if you want it. Anyways, I'm not getting this error. Neither am I seeing "HIT!" anywhere, even when I think I've hit the yellow circle. |
Author: | Tuxedo [ Sun Jan 09, 2005 10:14 pm ] |
Post subject: | |
No, I fixed that up and am sorry for the [code] error... I do not know where to put the graphics.... What I am trying do is have the little oval move around the screen and when you shoot it with the little red dots it will give you more points however I am unsure where to place the graphics for the "Hobos"...the other little oval that are yellow. Could you show me where to put it and tell me if it needs to go in repetitivly? Please and thank-you. ![]() |
Author: | Cervantes [ Mon Jan 10, 2005 9:01 pm ] | ||||
Post subject: | |||||
From my personal experience, I like to set my loops up like this:
And, to expand on the %output portion:
You should avoid using more than one cls, drawing the same thing more than once, using more than one View.Update, and using more than one delay (use more than one delay sometimes, but make sure it's embedded in an if statement. Perhaps an if statement to determine if it's the end of the level, or the round, or whatever.) -Cervantes |