(Variable) x (Variable)

Get help using Construct 2

Post » Sat May 19, 2012 5:45 am

When creating an object, I want to set the x-coordinate to a variable times another variable. The two variables are HandX and HandA How do i type it in the x-coordinate of the create an object box?
B
5
Posts: 38
Reputation: 501

Post » Sat May 19, 2012 6:09 am

I might have found the solution on my own. The original intent for the code was to draw a card to the Player's hand 70 pixels from the last card in the hand so i was going to do variable "CardsInHand" x "SpawnPoint" so if whatever amount of cards in hand the new card would always be drawn next to it.

But i realized im dealing with global vars. They dont change no matter what event so if i just do create object at HandX, 620 then it will spawn to whatever point is next of the last card in the hand because everytime your hand goes +1 or -1 HandX will +70 or -70.
B
5
Posts: 38
Reputation: 501

Post » Sat May 19, 2012 12:27 pm

See expressions in the manual.

To multiply two numbers use *:

HandX * HandA
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun May 20, 2012 2:13 am

Thanks! That knowledge was still useful.
B
5
Posts: 38
Reputation: 501


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests