Basic question about mouse clicks

Game Editor comments and discussion.

Basic question about mouse clicks

Postby clickrush » Wed Nov 23, 2011 10:22 pm

Hi everyone,

First of all my programming experience is ~0. I made a little shooter game 13 years ago with quickbasic but forgot most of the stuff anyway :)

Now iam messing around with game-editor and it's hella fun. Here's my problem:

I've made some kind of top-down character that runs around in all directions per mouse clicks and changes animations for 8 of them accordingly. It can shoot arrows too... Now I want it to slow down while "aiming", which should be while pressing the left mouse button. First I tried it simple and just made a global variable for the velocity of the actor. Thing is: the actor doesn't slow down during the movement but only for the next movement (move to).

Also I did't find out yet how to check for "mouse button is held down"/"released".

Thx in advance for clarifications and sorry for asking such a simple question but I really searched alot before posting here.

edit: just realized this should be in the "support" section. sorry for that I thought the section is for technical issues only.
clickrush
 
Posts: 5
Joined: Tue Nov 22, 2011 2:20 pm
Score: 0 Give a positive score

Re: Basic question about mouse clicks

Postby skydereign » Fri Nov 25, 2011 1:01 am

What I usually do is have a variable that holds the click state. When you have the mouse button down, you set it to 1, and when you have the mouse button up event you set it back to 0. That way you can check if it is 1 to run code to have it when it is clicked.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Basic question about mouse clicks

Postby clickrush » Fri Nov 25, 2011 12:08 pm

almost embarassing for me how simple your solution is haha, :) thx very much
clickrush
 
Posts: 5
Joined: Tue Nov 22, 2011 2:20 pm
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest