Point and Click Game

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

Re: Point and Click Game

Postby BlarghNRawr » Tue Sep 16, 2008 2:17 am

rhats what i thought, cuz you only wanted left and right animations
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 » Tue Sep 16, 2008 2:23 am

and i wanted away and towards the screen animations
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 11:00 am

This should be easy enough to do with the example I gave. If you look at the scripts for mouse down left and move finish you can see that it uses some simple geometry to figure out where the mouse click is in relation to the actor. Then it changes the animation. If you only want 4 animations (instead of 8 ) just change the script to a quadrant or whatever you need. If you have to, draw it out on paper and figure it out there first.

The animation itself is top down, but it could be anything you wanted. I used it as an example because I already had it from something previously.

Anyone is going to need to be able to do scripting to be able to do a simple game like the kinds of topics you are asking about (inventory, movement, etc).
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 10:57 pm

what am i changin to a quadrant?
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 11:42 pm

You know when you click in the screen? You need to figure out where that click was so that you can make a sensible choice of which animation to use.

No matter where on the screen you click, you can draw a single imaginary line (vector) between the click point and the point where the actor is. From that you can figure out the angle (like the degrees of a circle, but in radians instead of degrees).

In this case, North is 0, South is Pi (this is radians). Everything East is negative between 0 and -Pi. Everything West is positive between 0 and Pi.

You can see all the if (rads < -.4 && rads > 0) type stuff in the two actions I mentioned in an earlier post. Mine are 8, you can divide the numbers up into 4 (a quadrant).

If you can understand that direct North is 0 and direct South is Pi, then East is (- Pi / 2) and West is (Pi / 2).

To divide it up into a quadrant, you might use (just my own numbers, make up your own) rads < (Pi / 4) and > (- Pi / 4) is animate away, rads < (- Pi / 4) and > (- 3 Pi / 4) is animate Right, rads > (3 Pi / 4) or < (- 3 Pi / 4) is animate towards us and rads > ( Pi / 4 ) < (3 Pi / 4) is animate Left. Simple, right? It's a quadrant. You can tweak the numbers if you don't want the guy to animate up if someone clicks near to 45 degrees (clockwise/counter) from North. Maybe you want it to be more like 30 degrees left and right of North.
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 » Wed Sep 17, 2008 12:35 am

I'm jus not graspin it. Cud u make a demo please? :oops:
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 » Wed Sep 17, 2008 2:10 am

Did you look at the code, yet? Do you see what I'm talking about? The if statements... the numbers. That stuff.
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 » Wed Sep 17, 2008 2:24 am

I tried, but all that happened was it changed to the bacward animation an wouldnt do anythin else
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 » Wed Sep 17, 2008 2:38 am

Here is a visual of what I'm talking about.

illustration.png
Illustration of the quadrants around the actor for clickable regions and 4 animation cycles.


The illustration shows due North, South, East and West. They have a known value, in radians. radians = atan2(dx, dy) where dx = actors x - mouse x and dy = actors y - mouse y. This is in the script action for both mouse down left and move finish. You can see the actual math in the demo I provided earlier in the thread.

The illustration also shows the values for dividing up the screen into clickable quadrants relative to the actor. (The giant black X across the picture.) The values are just 1/2 the value of say, due North and due East. Northeast is (N + E) / 2, right?

If you don't understand what radians and Pi have to do with the circle, just think of them as numbers that you already know. You don't need to convince yourself of how I got them. Just treat them as numbers.

In this way, the clickable area is always relative to the actor. If the actor moves, the math still works and it makes sense when you click and actor animates. The animation seems sensible for the location of the click.
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 » Wed Sep 17, 2008 2:42 am

If you still don't get it, just upload your example which isn't working. I'll see if I can tell you how to fix it. That way you will still be writing your own game and hopefully it will make more sense. :lol:
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 » Wed Sep 17, 2008 2:51 am

i dont no how 2 up load a game
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 » Wed Sep 17, 2008 3:28 am

When you post a reply, there is a blue box below "save" "preview" "submit". It looks like tabs. One says "upload attachment".
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 » Wed Sep 17, 2008 3:57 am

it says The extension ged is not allowed
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 » Wed Sep 17, 2008 4:13 am

Yeah, you need to zip up the whole thing, ged and data directory. Upload the zip.
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 » Wed Sep 17, 2008 8:41 pm

put everything in a folder then right click and "send to zipped folder"
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

PreviousNext

Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest