Author |
Message |
mapmap
|
Posted: Tue May 18, 2010 4:14 pm Post subject: Colour Collision detection |
|
|
What is it you are trying to achieve?
I'm trying to create a game like bmtron on Turing
http://www.ccybernet.com/games/bmtron/bmtron.html
What is the problem you are having?
I don't know how I could have collision detection on my program and I want to know if I can have some sort of collision detection that checks if the character has went over someone else's trail.
Describe what you have tried to solve this problem
I have so far added collision detection to check if a player went off the screen and to check if the head of each others characters are touching which results in a tie.
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Monduman11
|
Posted: Tue May 18, 2010 4:18 pm Post subject: Re: Colour Collision detection |
|
|
post collision code please? cause i dont really know what ur trying to detect collision for. |
|
|
|
|
|
mapmap
|
Posted: Tue May 18, 2010 4:21 pm Post subject: Re: Colour Collision detection |
|
|
did u play the game in the link? |
|
|
|
|
|
Monduman11
|
Posted: Tue May 18, 2010 4:25 pm Post subject: Re: Colour Collision detection |
|
|
mapmap @ Tue May 18, 2010 4:21 pm wrote: did u play the game in the link?
no it doesnt load for me says there's a java error.. but if u want to do the collision detection for the trails you could have something like
code: | if chars (KEY_LEFT_ARROW) and whatdotcolour (posx - 10, posy + 24) = black then
put" you have touched the trail of player whichever"
end if |
|
|
|
|
|
|
mapmap
|
Posted: Tue May 18, 2010 4:28 pm Post subject: Re: Colour Collision detection |
|
|
oh thanks, is there a tutorial that explains it in more detail in the tutorial section? |
|
|
|
|
|
Monduman11
|
Posted: Tue May 18, 2010 4:33 pm Post subject: Re: Colour Collision detection |
|
|
yea there is but i played the game and i know what you mean now.
well to do that you could have
hope that helps |
|
|
|
|
|
Monduman11
|
|
|
|
|
andrew.
|
Posted: Tue May 18, 2010 5:37 pm Post subject: RE:Colour Collision detection |
|
|
I would recommend not using colour collision detection. Instead, check for the coordinates of the trails. It will be a bit harder to code, but will work a lot better than colour detection. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
mapmap
|
Posted: Tue May 18, 2010 5:44 pm Post subject: Re: Colour Collision detection |
|
|
Why is using color collision detection not as good?
And would I have to store every single coordinate in a array and then check if every player has touched any of those coordinates every single time the program loops? |
|
|
|
|
|
jcollins1991
|
Posted: Tue May 18, 2010 6:41 pm Post subject: Re: Colour Collision detection |
|
|
mapmap @ Tue May 18, 2010 5:44 pm wrote: Why is using color collision detection not as good?
And would I have to store every single coordinate in a array and then check if every player has touched any of those coordinates every single time the program loops?
I'm not sure what reason andrew is suggesting against it, but IMO colour collision detection isn't very practical... The only way it's going to work is if you have different colours for each thing you're trying to check for collision with, and if you want to do anything like have the colours of the snake fade to black closer to the edge of the snake it probably wouldn't work... Since its a fairly small game (probably only like 50x50 grid) an array should work, if you're keeping track of direction of each player all you have to do is add one to the direction of their movement and check that position in the array... The nice thing about that approach is that you can code the logic part of the game however you want and decide on the specifics of the graphics later...
note: I don't actually know Turing so I'm not sure how this approach would work, but it's fairly simple so I'm hoping it'd work in Turing XD |
|
|
|
|
|
|