Alice Community  

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

Reply
 
Thread Tools Display Modes
Getting the player to look at the mouse
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default Getting the player to look at the mouse - 04-25-2011, 04:02 PM

I've been planning my next game project in Alice as I approach the finish of my first big project (It's called Bravura, I'll probably post it within two weeks of now). My next project is inspired by the popular Steam game, Magicka. I want the character to always face the mouse, which I'm sure is possible, but I don't know how. I know I can get some hints from something I found a while ago that is a code for a First Person Scroll, where the mouse allows you to look around, but I don't get it. If someone could take a look at it (attached) and if they get it, explain how I might be able to make the character face the mouse, then I would be very grateful. I'd definitely put you in the credits! lolFirstPersonScroll.a2w

Last edited by Matchewawa; 04-25-2011 at 08:54 PM.
   
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 04-25-2011, 04:28 PM

Why don't you look at some of the other games on the boards that actually have the exact code you're looking for?

Like this one...
   
Reply With Quote
Thanks
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default Thanks - 04-25-2011, 04:59 PM

Thank you very much. I'll be looking this over for a while, cause I only half get it. I just want to know what I'm putting on so I can tweak, add, and optimize if needed.
   
Reply With Quote
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default 04-25-2011, 07:57 PM

Can you explain the equation that you used to move the pointatdummy and the turretpointer, where you had 4 equations, one of them being "( ( left dist - 400 ) / 58 )"
   
Reply With Quote
What I Have
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default What I Have - 04-25-2011, 10:26 PM

Here's what I have so far, but the wizard is acting screwy. I don't fully understand how the look code works, so I can't figure it out (and I really tried).
UnnamedMagickaInspiredGame.a2w
   
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 04-25-2011, 10:51 PM

Quote:
Originally Posted by Matchewawa View Post
Can you explain the equation that you used to move the pointatdummy and the turretpointer, where you had 4 equations, one of them being "( ( left dist - 400 ) / 58 )"
That is the equation that uses the centerpoint of the screen to determine where to move the object that the turret points at. The number 400 is half of 800, which is the first number in 800x600, which are the dimension of my Alice window when I play (you can change those dimensions in the preferences menu).
   
Reply With Quote
Works
Old
Matchewawa
Member
 
Status: Offline
Posts: 32
Join Date: Feb 2011
Default Works - 04-26-2011, 03:28 PM

OOP! Found the issue. Pretty obvious one. It was only reading the leftDist variable, which was applied to all four of the methods moving the dummies. I just needed to change the bottom two to the topDist variable so it reads the distance from both the top and left edge.
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 04-26-2011, 06:22 PM

Quote:
Originally Posted by Matchewawa View Post
OOP!
The first thing that popped into my head was Object Oriented Programming when I say that acronym!


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
Reply With Quote
Reply

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