----------------------------------- jedi-bob Wed Jan 21, 2004 10:54 am WALLS ----------------------------------- how can i make it so my player controlled cirlce cant go through walls? I checked the collision detection tutorial, but the rectangle one was to hard to figure out (it was poorly explained), and the oval detection only says when they hit. now help out, theres some bits in it for you. ----------------------------------- Andy Wed Jan 21, 2004 10:56 am ----------------------------------- use whatdotcolor and STOP POSTING STUPID QUESTIONS WITHOUT CONSULTING UR COMPSCI TEACHER AND THE TURING SOURCE/TUTORIAL SECTION ----------------------------------- jedi-bob Wed Jan 21, 2004 10:59 am ----------------------------------- what the hell is whatdotcolor, and how would i use it for my walls, also maybe you missed it but i said i checked the tutorials and it was poorly explained. ----------------------------------- Thuged_Out_G Wed Jan 21, 2004 2:06 pm ----------------------------------- whatdotcolor is used to check the color of a specified pixel. use it like this if whatdotcolor(x,y)=10 %where 10 would be the color of your box then ballxdir:=-ballxdir end if all that does is, if the x and y coords of the ball hit the color 10, then reverse the direction of the ball ----------------------------------- Cervantes Wed Jan 21, 2004 4:25 pm ----------------------------------- or without whatdotcolour... if ballxdir > maxx - 30 then ballxdir := -ballxdir end if ----------------------------------- jedi-bob Thu Jan 22, 2004 10:11 am ----------------------------------- i just want my ball not to go through the walls, not to bounce in a different direction (its not animated, it keyboard controlled) i just want it to stop, not bounce. ----------------------------------- Jedi-Jim Thu Jan 22, 2004 10:38 am ----------------------------------- Hey there Jedi-bob its me Jedi-Jim ----------------------------------- jedi-bob Thu Jan 22, 2004 10:40 am ----------------------------------- i haven't talked to you in along time, here have a bit. ----------------------------------- Jedi-Jim Thu Jan 22, 2004 10:40 am ----------------------------------- don't worry BOB they can't prove the little girl was telling the truth ----------------------------------- Cervantes Thu Jan 22, 2004 6:32 pm ----------------------------------- if ballx > maxx - 30 then ballxdir := -0 end if comon man with the info we gave you you could figure out how to do that... unless... do you know what ballxdir means?? ----------------------------------- DanShadow Thu Jan 22, 2004 10:51 pm ----------------------------------- hmm... now help out, theres some bits in it for you. That seems a lot like him trying to command us to help him....who would like to help someone who is commanding you to do something??? And you have barely any bits anyways, so bleh. Me, being the nice guy I am, will teach you the dark arts of the: :twisted:"whatdotcolor":twisted: var x, y, xmod : int := 200 xmod := 2 loop setscreen ("offscreenonly") View.Update Draw.FillBox (0, 0, maxx, maxy, 0) delay (2) Draw.FillBox (500, 150, 600, 250, black) Draw.FillOval (x, y, 20, 20, 12) x := x + xmod if whatdotcolor (x + 21, y) = black then xmod := 0 end if end loop This code will move a ball, but when it hits the wall (which is black)...it stops. whatdotcolor is used like this whatdotcolor(x,y)=color %(x,y)='x' and 'y' co-ordinate its checking what the dot color is at %color= the color of dot its checking for %soo..... if whatdotcolor(x,y)=red then put "AHH!! The whatdotcolor of x and y is red!!!" end if Understand??? Now ASK NICER next time!! ----------------------------------- Cervantes Fri Jan 23, 2004 2:31 pm ----------------------------------- *does a jig around DanShadow* Dan wants bits... Dan wants bits.... :P