Top-down movements and text that follows

Get help using Construct 2

Post » Wed Nov 06, 2013 2:42 pm

Hey again!
I want to make my "FPS" text stay still in the corner while my character moves around with the scroll to behaviour. I tried using the anchor behaviour but it still moves a little bit when I press down a key, http://gyazo.com/45aa133bcbdae59e62b7398b2fa81fa2.

One other problem is that I'm using the 8-directions behaviour on my character but I set it to 4-directions since I only have animations for up,left,down,right. But if I press both up AND left, for example, at the same time it freezez at the left-animation and moves up. How can I fix this?!
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Wed Nov 06, 2013 4:08 pm

Hi there. For the first problem you need to crate a new layer, and in it's properties set the paralax to 0,0. then move all GUI element to that layer.

for the second problem, i think you should set additional conditions to the player. so, "when up = animation up", "when up and left = animation up", "when left = animation left".

you'll need to place two conditions on the event and it will work as an AND.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Wed Nov 06, 2013 4:28 pm

Thank you!
I was thinking of doing that as backup (the character controls). But I wanted to check here if there was another easier way :P
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Wed Nov 06, 2013 4:39 pm

UPDATE: I tried: W is down + A is down -> Character - Set animation "up" + Character - simulate 8direction pressing Up.

But still same thing happens and it really starts getting on my nerves! :S Still freezes on the left animation first frame.. :(
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Fri Dec 06, 2013 10:05 am

bump..
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Fri Dec 06, 2013 10:15 am

You probably have conflicting events setting your animations.

something like :
- if a is down set animation to left
- if a+W is down set animation to up

so every tick the animation is set to left and then to up
which makes it seem like the animation isn't running

There are many ways of solving this, you should make sure it's impossible for both events to be true.

You could add a condition w is not down to the if a is down, that way it only triggers if a is down and w is not so that if a is down and w is down only the other event triggers.
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 » Sun Dec 15, 2013 11:46 am

no idea what you meant.
I checked for a every tick setting the animation, there was none.
Here's the CAPJ so you can download and have a look and maybe fix and? (a) C:
https://dl.dropboxusercontent.com/u/15696142/Test.capx
Website Twitter Indie Developer
B
20
S
6
G
4
Posts: 206
Reputation: 2,954

Post » Sun Dec 15, 2013 12:09 pm

You are using third party plugins in your capx, so I can't open it.

What I meant is that you probably have your events set up like this:

1.- If A is down - do this
2.- If W is down - do this
3.- If A is down and W is down - do this

If event 3 is true, event 1 and 2 are also true.

To prevent this you could do something like this:

1.- If A is down and W is not down - do this
2.- If W is down and A is not down - do this
3.- If A is down and W is down - do this

this way it's impossible for all three events to be true at the same time.

This could be simplified by using subevents and else statements, but the above explains the basics.

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 13 guests