jellyfish-like movement

Get help using Construct 2

Post » Tue Dec 17, 2013 10:06 am

hey guys, i want my objects to move like jellyfishes. i was thinking of setting the bullet behaviour speed to (mySpeed * sineBehaviour) that they will slow down and accelerate when they move their .. tentacles .. or whatever you wanna call it :D
but i would have to make a every tick event and i have 4 players, so it would be like:

every tick -> set SineVariable to sineBehaviour
every tick -> set movement speed of PlayersFamily to SineVariable

Im not sure about how i would store that sine behaviour in a variable and I don't like those every tick events since i want to port to mobile devices and this is very performance consuming. (correct me if I'm wrong)

I can't provide a capx at the moment because I'm not at home but I definetly will.

has any of you got a great idea how to set this up properly?

cheers! phil
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Tue Dec 17, 2013 11:37 am

This is an aesthetics question. We need to see how your jellyfish look like first. Beside, if you look at some games, they simply animate the whole jellyfish swimming in multiple frames instead. This would make the jellyfish look more dynamic and also eliminate the time required to make the jellyfish look right in programming... unless you have some other requirements.

If that's the case, and you want further advice, please say so.

I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Tue Dec 17, 2013 12:30 pm

In the sine variable, on the properties menu you can choose motion type. Inside that dropdown list there is a "value only" selection. You can, during the game, get that value by using sine.value property inside the events. You can do MySpeed = object.sine.value or sth like that. I think this should solve your problem if I got it right.
B
18
S
4
G
1
Posts: 332
Reputation: 3,149

Post » Tue Dec 17, 2013 4:15 pm

@keroberos
yeah, i was thinking of something like this too but then i got worried about the hitbox/Collision Mask of my player model. i would have to leave transparant space and make the sprite bigger than it actually is and change the collision mask for every frame and i'm always a bit concerned about performance.
the problem is, i can't really show you "my jellyfish" because my artists are damn lazy and want to get on with the game .. but thank's for your idea. i will try both ways and if I need further information/help, I'd contact you.

@Windwalker
that's exactly what i was looking for. thank you very much!


I'll compare performance and stability of both methods if i have enough time.
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Tue Dec 17, 2013 4:32 pm

You could just crop the transparent area of the sprite if the origins are at the right place..

That way you won't have unnessecary transparancy at the sides. LittleStain2013-12-17 16:33:53
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: No registered users and 7 guests