0 Favourites

help me with two sprite follow mouse alternately

  • Hi im very new on game development and need help for my problem here..

    i have two sprite object and i want them follow and move with mouse and also facing the mouse angle if i press left click.. but i want the sprite moving one by one depend on which one i click the sprite object, as an example if i left click "sprite1" and the other "sprite2" remain and not effected even if both sprite on very near position or very close..

    can anyone help me with this.. i almost had a headache try to solve this <img src="smileys/smiley5.gif" border="0" align="middle" />

    sorry for my bad english

  • Hi, stev. I'm guessing you would want to put a selected variable in the sprite? For example, sprite1.selected = 1 when on mouse/touch. Then, register the position and move your selected sprite to it. Cheers.

  • RockyCake HI thanks for ur replay

    can you tell me where to input the variable is on global variable or sprite variable? where i can learn about the variable expression?

    im very confuse with the variable system.. <img src="smileys/smiley5.gif" border="0" align="middle" />

  • Hello, no problem! Anyways, your sprites have a component called 'Instance variables' properties, its just above the behavior properties.

    Click add/edit and it will pop out a window. Add a new variable on it and that's pretty much about it.

    here is the link for more info. scirra.com/manual/73/instance-variables/page-1

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • ok im starting to understand now..

    i've read this tuts and understand a bit

    scirra.com/tutorials/158/veryvariable-toggle-between-two-states

    but how i able to set different value in variable to a multiple sprite say it 3 object player with only same move like "left click"

    example i want a "ball_sprite1" from original position out of layout when i press left click -> move to "player1" position (x,y) then release click it back to original position and if i press same left click to the other "player2" i want the same "ball_sprite1" to move to position (x,y) of "player2" to.. i mean how i able to order the system if i got only one same action is the "left click" action

    sorry if i ask a lot & write with the wrong word / grammar..

  • OKKK i finally manage with variable THANKs! RockyCake   <img src="smileys/smiley14.gif" border="0" align="middle" />

    i finally understand using the variable thank's and my problem is solve

    need extra tweaking for diffrent value like 1 or 2 and global variable also i dunno if any other methode but im using two dummy sprite ball with same shape and colour and global variable set to 0

    i think im begin to love this software.. <img src="smileys/smiley20.gif" border="0" align="middle" /> this is my first for creating a game but scirra make it in simple & nice way for a game programing awesome thanks guys

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Sprite Font Generator - v3
368 112,251
RetroDaddy's avatar
RetroDaddy
Unread hot topic Locked topic
198 18,650
Tom's avatar
Tom Construct Team Founder
Unread hot topic
86 28,702
St4rDu57's avatar
St4rDu57