How do I need help

Get help using Construct 2

Post » Mon Sep 22, 2014 3:47 pm

paremeters for sprite: set animation it tells me im missing syntax . how do you know what your pose to type as your code ?
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Mon Sep 22, 2014 3:55 pm

Have you read the manual ?

Set animation
Change the currently playing animation to another animation. Animations are identified by their name (case insensitive). The new animation can either play from the beginning or from the same frame number as the last animation was on (current frame).


In the parameter box it states:

"The name of the animation to set"

So if you have an animation called 'BossWalk' for instance, then you would set the animation name to

"BossWalk"
If your vision so exceeds your ability, then look to something closer.
Moderator
B
131
S
29
G
81
Posts: 5,328
Reputation: 56,630

Post » Mon Sep 22, 2014 4:11 pm

I dont have any animations made I just have a basketball rim that I want to move left and right controlled by the player
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Tue Sep 23, 2014 3:24 pm

So if you don't have an animation, why are you trying to set it and how do you suppose that should work?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 23, 2014 4:27 pm

I think you're confusing animations with movement @lilvee1989 . What you want to do is use on key pressed(if you're making a game for pc) or on touch(if you make for mobiles).
So in your case it would be something like
Event: on left arrow pressed
action: set basketball position to (basketball.x-20, basketball.y)
Event: on right arrow pressed
action: set basketball position to (basketball.x+20, basketball.y)

Modify the 20 to whatever you want, depending on how far you want the ball to move. Hope that helps, if you have anymore questions let us know.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Wed Sep 24, 2014 12:07 am

Thanks Vikings but in case I did do this on mobile can i actually have it where the player is moving the rim around with his thumb pressing on the rim image on the touch screen device instead of having control direction arrows displayed on the screen ?
B
11
S
3
Posts: 216
Reputation: 1,279

Post » Wed Sep 24, 2014 4:06 am

lilvee1989 wrote:Thanks Vikings but in case I did do this on mobile can i actually have it where the player is moving the rim around with his thumb pressing on the rim image on the touch screen device instead of having control direction arrows displayed on the screen ?

Drag and drop behavior?
B
28
S
8
G
1
Posts: 226
Reputation: 2,865

Post » Thu Sep 25, 2014 2:06 pm

lilvee1989 wrote:Thanks Vikings but in case I did do this on mobile can i actually have it where the player is moving the rim around with his thumb pressing on the rim image on the touch screen device instead of having control direction arrows displayed on the screen ?


I'm sure you can, but I don't know enough about touch controls yet to advise you on how to achieve that.
B
21
S
11
G
6
Posts: 414
Reputation: 5,335

Post » Thu Sep 25, 2014 2:16 pm

You could either use the drag and drop behaviour as suggested above or create your own version of a drag and drop behaviour with set position and calculating offset between touch and origin..

You should probably add some conditions to keep your sprite within the bounds you´d like, but it should be relatively easy to achieve..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: ramyaswetha, Yahoo [Bot] and 7 guests