The Daily Click ::. Forums ::. Klik Coding Help ::. Point n Click the answer...
 

Post Reply  Post Oekaki 
 

Posted By Message

Phredreeke

Don't listen to this idiot

Registered
  03/08/2002
Points
  4504

You've Been Circy'd!VIP MemberPS3 Owner
2nd August, 2007 at 11:51:53 -

Slink asked in a previous post:

When the user clicks wherever I want "Hero" to go there. =/

Simple as that I'm affraid! Any help please?


Strangely enough, after writing my reply. The post wasn't there anymore Here's my replay anyway:

This is how we did it in them old days.

1. Make your hero a ball object. Stop its movement at start of frame.
2. Make an active object with an outline of where the hero should "stop"
3. Make another active object. When clicking set the X and Y coordinates to XMouse and YMouse, set the hero to look in direction of that object and start movement.
4. When the hero collides with either of the two mentioned objects, stop his movement.

 
- Ok, you must admit that was the most creative cussing this site have ever seen -

Make some more box arts damnit!
http://create-games.com/forum_post.asp?id=285363

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
2nd August, 2007 at 12:05:38 -

Thank you, Phreddy! Sorry for deleting the topic, I remembered an old way of doing it just after posting and thought I use that. However this method works better for me! Thank you very much!

 
Image

Tell 'em Babs is 'ere...

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
2nd August, 2007 at 12:14:14 -

You wouldn't happen to know of a way to restrict this movement to horrizontal only, would you?

 
Image

Tell 'em Babs is 'ere...

The Chris Street

Administrator
Unspeakably Lazy Admin

Registered
  14/05/2002
Points
  48487

Game of the Week WinnerClickzine StaffAcoders MemberKlikCast StarVIP MemberPicture Me This Round 35 Winner!Second GOTW AwardYou've Been Circy'd!Picture Me This Round 38 Winner!GOTM December Third Place!!
I am an April FoolKliktober Special Award Tag
2nd August, 2007 at 12:43:46 -

Yea. Using the "Compare Two General Values" command...

Xmouse is GREATER than X("Hero")
+ Repeat while Mouse Key is pressed
= Set X Position of X("Hero") to X("Hero")+2

Xmouse is LOWER than X("Hero")
+ Repeat while Mouse Key is pressed
= Set X Position of X("Hero") to X("Hero")-2

 
n/a

Phredreeke

Don't listen to this idiot

Registered
  03/08/2002
Points
  4504

You've Been Circy'd!VIP MemberPS3 Owner
2nd August, 2007 at 12:45:22 -

You could set the Y position of the object in step 3 the same as the hero.

Alternatively you could do it this way.

1. When clicking, set one of Hero's alternable values to XMouse.
2. If Hero's X position is less than that value, set it to X("Hero")+1
3. If Hero's X position is more than that value, set it to X("Hero")-1

This will however not stop the Hero from walking over things you don't want him to be able to walk over. Could be fixed without much trouble though.

 
- Ok, you must admit that was the most creative cussing this site have ever seen -

Make some more box arts damnit!
http://create-games.com/forum_post.asp?id=285363

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
2nd August, 2007 at 13:29:25 -

"Thank you, Phreddy! Sorry for deleting the topic, I remembered an old way of doing it just after posting and thought I use that. However this method works better for me! Thank you very much!"

Dont delete topics! :I Even if you know the answer, its nice to have the information up incase someone else is trying to accomplish the same thing you are ;D

 
n/a

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
2nd August, 2007 at 17:29:57 -

thanks for all the help guys, everythings coming along smoothly

Oh, and I'll remember not to delete topics from now on!

 
Image

Tell 'em Babs is 'ere...
   

Post Reply



 



Advertisement

Worth A Click