Computer Science Canada turing game object collision |
Author: | Gold Flame [ Thu Jul 21, 2011 9:29 pm ] | ||
Post subject: | turing game object collision | ||
What is it you are trying to achieve? Begining the programming/coding of a video bame with combat similar too zelda a link to the past What is the problem you are having? I dont know how to make the characters and objects or boundaries on pathways collide I also need the edge of the character to collide with the edge of another character as oppsed to the rectanguler edges of the transparent image colliding Describe what you have tried to solve this problem I havent tried it yet i just havent the foggiest clue how to do it Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) my code is just beginning. i havent yet converted it from the other code i used in highschool but heres what i have, although not entirely realevent yet
Please specify what version of Turing you are using 4.1.1.0 |
Author: | Raknarg [ Fri Jul 22, 2011 5:39 pm ] |
Post subject: | RE:turing game object collision |
First off, you should state all your procedures and variables at the beginning. |
Author: | Tony [ Fri Jul 22, 2011 6:00 pm ] |
Post subject: | RE:turing game object collision |
A good place to start figuring out collision detection is to draw out a few sketches of colliding objects on paper. |
Author: | Gold Flame [ Fri Jul 22, 2011 7:42 pm ] |
Post subject: | Re: RE:turing game object collision |
Raknarg @ Fri Jul 22, 2011 5:39 pm wrote: First off, you should state all your procedures and variables at the beginning.
yes this a old game an im disassembleing the code to make a new game |
Author: | Gold Flame [ Fri Jul 22, 2011 7:46 pm ] |
Post subject: | Re: RE:turing game object collision |
Tony @ Fri Jul 22, 2011 6:00 pm wrote: A good place to start figuring out collision detection is to draw out a few sketches of colliding objects on paper.
I just need to know how to program the main character ![]() to stop when he runs into another character or a tree or wall instead of walking right through it. a jumping system would be helpful too cuz i dont even know where to start on that any advice? |
Author: | Zren [ Fri Jul 22, 2011 8:12 pm ] |
Post subject: | RE:turing game object collision |
Collision Detection is way easier to understand if you start out with thinking of dots on a grid, then evolving into basic shapes (rectangles and circles). In your case, I'd suggest the rectangles as they can surround your sprites more accurately. Think along the lines that only one thing can be somewhere at once (obvious). So when you move, you make sure no other objects are there first. Walls included. Start with only two objects, link and your wall. if (wall.x = link.x and wall.y = link.y) then link is currently at the coordinates where the wall is. Remember, you want to check where link will be before moving, not where he is right now. Once you've got it so link can't move into that one point in space, try making the wall a rectangle. Then try having link as a rectangle. |