
-----------------------------------
Vertico
Thu Apr 14, 2005 5:57 pm

Help with whatdotcolor
-----------------------------------
trying to make a pacman game, and i am stuck. im trying to get the oval 2 stop when it reaches the blue walls but when i try and do

if whatdotcolor (x , y ) = blue then

it doesnt understand it and lets the oval go right throught the blue wall.
but if i put 

if whatdotcolor ( x, y ) not= black then
it works and stops when it hits the blue wall. this isnt good cuz i want 2 put in coins and warps but if it stops when its not black then that stuff isnt going to work.

can someone show me how 2 use this, or maby an easyer and faster way.    thz. :D

-----------------------------------
Martin
Thu Apr 14, 2005 6:14 pm


-----------------------------------
Don't use whatdotcolour, and instead use a 2d array to store your map.

-----------------------------------
Vertico
Thu Apr 14, 2005 6:21 pm


-----------------------------------
i dont understand what u mean by 2d array

-----------------------------------
Martin
Thu Apr 14, 2005 6:34 pm


-----------------------------------
Search the forums for a 2d array tutorial.

-----------------------------------
Andy
Thu Apr 14, 2005 6:50 pm


-----------------------------------
martin u sux... go whatdotcolour!! see you have to check the next step, you need to check if (x+1,y) or (x-1,y) or (x,y+1) or (x,y-1) is blue

-----------------------------------
Vertico
Thu Apr 14, 2005 7:00 pm


-----------------------------------
andy can u give me the exact code for that. PLZ :shifty:

-----------------------------------
Andy
Thu Apr 14, 2005 7:13 pm


-----------------------------------
sure... why dont i just do the whole freaking project for you while im at it? use ur brain, thats why you have one, if you cant, then too bad, drop compsci

-----------------------------------
Token
Thu Apr 14, 2005 7:52 pm


-----------------------------------
heres what you have to do, you have to check if 1 pixel in front of your oval is blue, not the center of your oval, because it will obviously be blue.. so do somthing like this


if whatdotcolor (x , y+radius ) = blue then %%if your heading up


-----------------------------------
jamonathin
Fri Apr 15, 2005 7:44 am


-----------------------------------
I think you just took away andy's point.

-----------------------------------
Martin
Fri Apr 15, 2005 8:06 am


-----------------------------------
Make sure you don't draw the pacman until AFTER you use the whatdotcolour.

-----------------------------------
Vertico
Fri Apr 15, 2005 2:29 pm


-----------------------------------
i found out what i was doing wrong. the picture was "brightblue" instead of just blue. even thou they look almost the same.

-----------------------------------
Token
Fri Apr 15, 2005 4:25 pm


-----------------------------------
no i didnt give him the exact code i just gave him an idea of what he had to do, if i were to give him all the code like the if statement for all 8 directions then that would be taking away andys point
