Point and Click Game

You must understand the Game Editor concepts, before post here.

Point and Click Game

Postby GuybrushThreepwood » Fri Sep 12, 2008 10:15 pm

I'm making a game and want to make the movement so that when the mouse is clicked, the actor moves to where you clicked. How could I do this with as little scripting as possible?
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Point and Click Game

Postby BlarghNRawr » Sat Sep 13, 2008 12:30 am

ummmmm...
put a filled region over the whole screen

then, mouse button down
move actor to mouse positon
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Point and Click Game

Postby GuybrushThreepwood » Sat Sep 13, 2008 8:26 pm

That worked, but how do I make the animation change to left if I click on the left side of him and change to right on the right side of him?
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Point and Click Game

Postby BlarghNRawr » Sat Sep 13, 2008 9:50 pm

i would put 2 more filled regions on both sides of him, and then parent them to ur moving actor, then if you click the left one, change animation to charleft and change animation to charleft for the right one
WARNING: this is just my way, there is probably a MUCH easier way

(on an unrelated note... how do i pronounce your name?)
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Point and Click Game

Postby GuybrushThreepwood » Sat Sep 13, 2008 10:03 pm

Guy(Like a person)Brush(Like a paint BRUSH)Threep(Like the #3 with a p)Wood(Like a log)
Guy-Brush Threep-wood
Guybrush Threepwood
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Point and Click Game

Postby BlarghNRawr » Sat Sep 13, 2008 10:04 pm

:lol:

so did it work?
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Point and Click Game

Postby GuybrushThreepwood » Sat Sep 13, 2008 10:59 pm

Ya but how do I make the animation stop after he's done moving?
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Point and Click Game

Postby BlarghNRawr » Sat Sep 13, 2008 11:02 pm

hmmmm...
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Point and Click Game

Postby edh » Sun Sep 14, 2008 11:26 pm

You'll need to do some scripting eventually.

Here's a simple approach to get started. You will probably end up with some "moon walking" unless you do something clever.

To make the actor follow the mouse, create a canvas which is larger than the view.
Add an event to the canvas: mouse button down, left button.
Add action: move to, select the actor you want to move, relative to mouse position.

Run that. You actor guy should move to wherever you click.

To make the character animate and then stop once he has reached his position, do this.
Add an event to the actor, move finish.
Add action: change animation to whatever the stop animation is.

You're going to need code though. You will want to detect where the mouse x and y are so you can choose which animation to use (Walk North, Walk NE, Walk E, ...) and which animation to stop on (Stand North, Stand NE, Stand E, ...). In that case, you would choose script events for everything and make the right function calls from the script instead of the editor interface.
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: Point and Click Game

Postby BlarghNRawr » Mon Sep 15, 2008 1:04 am

i knew there was an easier way :lol:
Download Game Music
current projects:
Bold! ?% Started mechanics
Unnamed puzzle game 60% --i need a name!--
User avatar
BlarghNRawr
 
Posts: 767
Joined: Wed Jun 25, 2008 12:36 am
Location: Not using G-E anymore. Now using Source SDK.
Score: 27 Give a positive score

Re: Point and Click Game

Postby edh » Mon Sep 15, 2008 1:18 am

Yeah, the canvas is really the way to go, from what I experimented with. As the view changes you can move the canvas, too.
The first hard part is the animation. Then it starts to get more complicated fast. It won't be long into it before you need to use scripts to do all this.
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: Point and Click Game

Postby edh » Mon Sep 15, 2008 3:02 am

Here, I just threw this together as an example. The actor has 8 directions. The moonwalk might not be so bad if I hadn't put the feet in there.

screenshot.png
The actor goes to the location of the mouse click. The demo chooses an appropriate animation direction for walk cycle and ends with the actor in the appropriate standing direction.

edh-follow-mouse.zip
EDH Follow Mouse example.
(236.95 KiB) Downloaded 193 times
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: Point and Click Game

Postby GuybrushThreepwood » Mon Sep 15, 2008 10:51 pm

I tried it, but all that happened was when i started, the animation only changed to my right animation
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Re: Point and Click Game

Postby edh » Tue Sep 16, 2008 12:45 am

I'm sorry, I don't understand. Do you mean you downloaded it, ran it and it didn't animate correctly? Or you changed it and it didn't animate correctly?

Can you explain more. I'll try to help.
User avatar
edh
 
Posts: 233
Joined: Thu Sep 13, 2007 12:17 am
Location: Maine, USA
Score: 14 Give a positive score

Re: Point and Click Game

Postby GuybrushThreepwood » Tue Sep 16, 2008 1:38 am

Yours is like a birds eye view, and mines like side to side scrolling, so when I tried your way, it had one animation for all directions, and didnt stop
Pirate: You fight like a diary farmer!
Guybrush: How appropriate, you fight like a cow!
User avatar
GuybrushThreepwood
 
Posts: 94
Joined: Sun Jul 06, 2008 12:23 pm
Location: Melee Island
Score: 2 Give a positive score

Next

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest