text follow player

Get help using Construct 2

Post » Tue Oct 29, 2013 4:07 am

i trying to create some user feedback. when i collect a coin i want a number to pop up and follow the player with a bit of lag. kind of like used to happen in the old defender game. of course you might pick up a number of 'coins' so may be more than one on screen at a time.

at the moment im creating a text instance on collision between player and coin then a for each to set position of the text. its static tho because the for loop is happening on a collision event and not an every tick event

plus i cant remember/dont know the formula for lag ...obviously minus time or * by UID doesnt work lol

really its a sad mess at the moment...any ideas how to do this

blade33ru2013-10-29 04:10:45
B
6
S
1
Posts: 23
Reputation: 427

Post » Tue Oct 29, 2013 11:42 am

You could add the FADE behaviour to the text object and fade it in ?
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Tue Oct 29, 2013 9:12 pm

FYI ive got very acceptable results using the FADE behaviour and also using the LITE Tween plugin. im kind of bumbed i coudnt figure it out natively.

https://dl.dropboxusercontent.com/u/8035591/PENGUINfunctions.capx

the relevant part is the feedback group. youve got to install the lite tween plugin...for it to work as is

if anyone can point a way to doing a similar behaviour natively, would be much appreciated

excuse the grfx...this is a learn construct project,not a grfx projectblade33ru2013-10-29 21:31:06
B
6
S
1
Posts: 23
Reputation: 427

Post » Tue Oct 29, 2013 9:58 pm

Pin - Rope Style would probably work as well and you safe you the plugin installation ^^
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 788
Reputation: 3,788

Post » Tue Oct 29, 2013 9:59 pm

Or try the lerp function :)

From the manual: lerp(a, b, x) Linear interpolation of a to b by x. Calculates a + x * (b - a).
B
47
S
14
G
7
Posts: 603
Reputation: 8,151

Post » Tue Oct 29, 2013 10:35 pm

yeah ive been trying to do lerp for the past hour with no good results...text just kind of sits there and fades out lol...im using lerp for my health bar...i understand it more or less but not in the context of movement so muchblade33ru2013-10-29 22:35:49
B
6
S
1
Posts: 23
Reputation: 427

Post » Wed Oct 30, 2013 2:32 pm

update....someone just pointed out to me i can get the effect using bullet with acceleration.

doh!

still need to investigate lerp more tho
B
6
S
1
Posts: 23
Reputation: 427


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 12 guests