How do I get a Pinned a Sprite to move vertically via Sine?

Get help using Construct 2

Post » Mon Mar 07, 2016 6:35 am

I've got a head that has two mouth pieces pinned to it and I want the two mouth pieces to move up and down but that's impossible because they are pinned to the head. So how can I possibly do it?

Here's a Capx: https://www.dropbox.com/s/6qks7a3kna4gw ... .capx?dl=0
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Mon Mar 07, 2016 11:02 am

Good question - and I have no clue how to solve it

But I have a work around - you could make a mouth up and down animation instead of a single frame. I think in this example it would work nicely.
The other (stupid) idea I had was to jump trough a cycle of different origin points.

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Fri Mar 11, 2016 2:42 am

@fm4fanAT, there's a way to change origins points? How?
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Fri Mar 11, 2016 3:04 am

Yes - here is a simple example

make a few Imagepoints to your objPlayer (in this case 4)
make a variable called gVariable and add every second +1
also every second set the gVariable to %3 (3 stands for the number of imagepoints -1 > so if 4 it rewrites it to 0)


Action
objSprite > setPosition to objPlayer (imagepoint = gVariable)

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], kizlengames and 6 guests