Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do I make things solid!????
Old
travis551
Guest
 
Status:
Posts: n/a
Default How do I make things solid!???? - 11-09-2010, 08:22 AM

I need help making objects solid so my guy doesnt go through them.
How would this be done?
I'm making a skate game and i want him to go over the ramp but he goes through it and he goes through the ground???
HELPPPPPPP
please!!!!
Thanks.
   
Reply With Quote
Old
yaya
Guest
 
Status:
Posts: n/a
Default 11-10-2010, 10:00 AM

I have this problem too.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 11-10-2010, 10:37 AM

Do you want it to act like the walls in this maze game? The player cannot go through the hedge walls. This is the collision detection that I created in Alice that I used to stop an object (the girl) from going through certain other obejcts (the walls).
Attached Files
File Type: a2w Maze.a2w (1.08 MB, 187 views)


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
yaya
Guest
 
Status:
Posts: n/a
Default 11-11-2010, 12:04 AM

How do you do the collision detection?
   
Reply With Quote
Collision detection
Old
GoGators
Senior Member
 
GoGators's Avatar
 
Status: Offline
Posts: 191
Join Date: Jun 2010
Location: In a house in a city in a state in a continent in a planet in a galaxy
Default Collision detection - 11-11-2010, 01:39 AM

Here is a very good question. I searched for months and could not find the answer for three months I will put more detail into my next two posts.

1st will be on sphere collision detection and the second will be on box collision.


------------------------------------------------------------------------------------------
Signature is under renovation.
  Send a message via Yahoo to GoGators  
Reply With Quote
Old
travis551
Guest
 
Status:
Posts: n/a
Default 11-11-2010, 08:13 AM

thanks for your help
ill try the file download
but i mean like my skater goes through the ramps and rails
and when i move him up and down he goes through the ground
   
Reply With Quote
Old
beachbum111111
Senior Member
 
beachbum111111's Avatar
 
Status: Offline
Posts: 852
Join Date: Feb 2010
Location: under your bed
Default 11-11-2010, 09:19 AM

box collision is a pain in the butt


"Don't lead me into temptation I can find it myself"
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 11-11-2010, 11:39 AM

Its really a simple concept, you just have to think about it not as a "solid object", but more like a forcefield that pushes you away when you try to go near it. The when you walk into the forcefield, it pushes you back at the same speed that you are walking towards it, making you stay still. Thats really what you are trying to achieve, now just think about the dimensions. Look again at my collision method and you will basically see that all I am doing is saying "If the object is touching the wall, then the object gets pushed backwards". What is confusing is that huge if/else statement's argument. It has a lot of "object's distance to the (direction) of wall > (distance)" and stuff like that, but all that is is me describing the dimensions of the wall so that the program knows when the object is walking into the wall, and when it is walking next to the wall. If the wall is only 2 feet long (away from the center), and the person is walking 3 feet away, then they will not hit the wall, and the method will realize that. Once the object is touching the wall, it pushes it back. There is also the list part, but that is just so that I don't have to write a collision method for every specific wall, I can just put them all in a list and have ever wall collision run through that one method.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Old
travis551
Guest
 
Status:
Posts: n/a
Default 11-12-2010, 08:11 AM

yeah it is kinda confusing
but thanks for your help and ill check out your other games
ill try and figure it out
because i want my guy to grind the rails and go over the ramps and what your telling me wont help me.

Last edited by travis551; 11-12-2010 at 08:13 AM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 11-13-2010, 08:03 AM

Ahh, I see. What you are asking though is even easier than the wall collision that I was explaining, but also a skating game would take a bit of physics to make work correctly, so I doubt you will be able to get the game to be what you want it to be.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Reply

Tags
game, skate

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.