Alice Community  

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

Reply
 
Thread Tools Display Modes
Stop walking through walls like a ghost
Old
falcolobo
Senior Member
 
falcolobo's Avatar
 
Status: Offline
Posts: 87
Join Date: Sep 2010
Exclamation Stop walking through walls like a ghost - 10-07-2010, 07:07 PM

I'm making a first person shooter game, first hurtle is stop my character from walking through buildings like a freaking ghost.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-07-2010, 09:27 PM

You and everyone else on the boards, dude.

Easy solution: have the arrow keys move your camera.

Hard solution: make a bunch of squares that check to see if the camera is too close to a wall and move it backward.
   
Reply With Quote
Old
falcolobo
Senior Member
 
falcolobo's Avatar
 
Status: Offline
Posts: 87
Join Date: Sep 2010
Exclamation 10-08-2010, 06:42 PM

Okay, easy solution it is.....but how do I do that? I have the camera's vehicle as the gun.... I use Alice 2.2
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 10-08-2010, 06:47 PM

Create an event that says "let the arrow keys move the camera".

Be warned, however, that the camera can still slip through tiny cracks.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 10-08-2010, 07:41 PM

Also, it can move like a ghost backwards still.
   
Reply With Quote
Old
falcolobo
Senior Member
 
falcolobo's Avatar
 
Status: Offline
Posts: 87
Join Date: Sep 2010
Default 10-08-2010, 08:42 PM

All right, then can some one explain to me the hard way?
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 10-08-2010, 09:46 PM

I would like to help, as this is one of my expertises here on the Alice forums, however I cannot spend a lot of time explaining because I have to leave very soon, so I have to be a hypocrite and say: look at my maze world.

Lol, I always get mad at people when they say to just look at their example worlds, but in this case I am hoping it might help a little more. Look for the "collision detection" method. All of the walls (squares) where you want the collisions to take place have to be facing outwards towards the person (so the front of the wall always has to be facing out). The link to my maze program is in my signature below.

Setting the arrow keys to move the camera really would be a lot easier. Just set the camera's vehicle to the world, and the gun's vehicle to the camera, and you will be all set, but if you feel that you want a little more freedom in your collision, you can try my way. I have to warn you though it will be confusing and may take a few hours to complete.


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
falcolobo
Senior Member
 
falcolobo's Avatar
 
Status: Offline
Posts: 87
Join Date: Sep 2010
Default 10-12-2010, 08:48 PM

Put every time I do that (guns vehicle to camera) there is an error
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 10-13-2010, 04:09 PM

Thats probably because your camera is already vehicle to your gun, and you are moving the gun. Making the gun vehicle to the camera while the camera is already vehicled to the gun would not make sense if you think about it.

What you have to do is make your camera vehicle to the world first, then make your gun vehicle to the camera, then change your movements so that the camera is moving and not the gun. Is that better or is there still an error?


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
falcolobo
Senior Member
 
falcolobo's Avatar
 
Status: Offline
Posts: 87
Join Date: Sep 2010
Default 10-13-2010, 06:05 PM

No it doesn't work.
   
Reply With Quote
Reply

Tags
collsion detection, if/else statements, walking through objects


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.