Jump to content

  • Log In with Google      Sign In   
  • Create Account


Starting a point-and-click game, moving a char in X-axis (AS3)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 JETeran   Members   -  Reputation: 273

Like
0Likes
Like

Posted 07 August 2012 - 08:56 AM

Hello evereybody !!

All the topics I started are some of the features I want to add to a game I'm working on, it will be a point-and-click game.

So I would like to know what you think about some things.

1) What do you think? Is it good to have the click and the use of the keyboard to move the character? (in a game design level) So far, I want to implement only move the char with the click of the mouse.

2) I can manage to handle the development of the char with the keyboard, but how can I do it with the mouse, in the way that the char moves to the place I click, then stops?

Making some research, I found that I can set action to a char with flags, like: if 'D' is pressed, charMoveRight=true; if this is true: character.x ++; else charMoveRight = false.

Now for the mouse click, I believe that can be something very alike: if mouseClick, charMove=true; if this is true: the character has to move where the mouseX is (consider that the char will only move in X)

Am I in the right track?? I think it have to be something that tells the char the place where it has to go (left or right) and when this happens, active a flag like: charWalks: = true; else charWalks = false; What do you think??

Thanks for your guidance guys !!

Success with courage,

José Eduardo Terán

Project Management & Game Programming. DSK International Campus

Indie Game Developer
Google + Account


Sponsor:

#2 prototypical   Members   -  Reputation: 301

Like
1Likes
Like

Posted 07 August 2012 - 04:27 PM

Depends on details of your control design.

But one distinct aspect is that with keyboard control you are basically checking every tick if a button is pressed and then moving the character or setting a flag for another part of the code to move the character/update the animation etc.

With the mouse control you suggest, you are clicking on a location and I'd assume that the goal is now to move to that location over a given amount of time.

Depending on the design of your animation/movement system, how you make that happen can differ.

Here is a great tutorial that I suggest you check out regarding vectors :

http://tonypa.pri.ee/vectors/start.html

It's not just about movement and this specific topic, but I'd suggest learning this aspect to better understand what you need to do.

Edited by prototypical, 09 August 2012 - 03:16 PM.


#3 JETeran   Members   -  Reputation: 273

Like
0Likes
Like

Posted 08 August 2012 - 08:25 PM

Thanks once again prototypical for your response.

With the mouse control you suggest, you are clicking on a location and I'd assume that the goal is now to move to that location over a given amount of time.


Indeed, in the game you will click a location and the character will walk in that direction (only on X-axis). Very close to the mechanics used in Maniac Mansion game. What will do is play the "moveToRight" or "moveToLeft" animation when the player either clicks to a right or left position of the character. With this in mind, is there a way / method I can activate the motion of the character from A (initial position) to B (clicked position) and stop the animation and movement as soon as the char gets to B?

Here is a great tutorial that I suggest you check out regarding vectors :

http://tonypa.pri.ee...tors/start.html


Thanks for the link, I will read it to better understand vectors and it's usage.

Really happy with your responses prototypical, let's keep in touch !!

Edited by JETerán, 08 August 2012 - 08:26 PM.

Success with courage,

José Eduardo Terán

Project Management & Game Programming. DSK International Campus

Indie Game Developer
Google + Account





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS