Character won't dislay

Get help using Construct 2

Post » Mon Oct 08, 2012 10:19 am

I have a background picture set up, and on the 1 layer I have one sprite with an animation yet he won't appear on the layout. He is set to visible, opacity is 100, initial visibility is visible...

Why won't he appear on the layout when I run it.. why not?
B
4
Posts: 24
Reputation: 348

Post » Mon Oct 08, 2012 10:46 am

Ok, it was actually a problem with the run function. It kept displaying just the background when I first ran it. I closed my browser and tried again and it worked, but now it's stuck again.

Is there a way to fix this? The run function in the window won't show any new settings I make, even if I save them first.
B
4
Posts: 24
Reputation: 348

Post » Mon Oct 08, 2012 11:05 am

Is the sprite appearing BEHIND the background? Make sure the background is on bottom of the layer. Better yet, place it on background layer that is on bottom of all.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Oct 08, 2012 11:54 am

I checked that and it was set properly. I'm not sure what I did, however it seemed to be a problem with my browser, only displaying the first run screen each time, which was just of the background.

It's good now though, thanks.

However I do have another issue, with getting my character to move. I want him to move down while the down arrow is pressed and to play an animation, and then I want it all to stop when the down arrow is released. How do I do this? And I don't want him to slide or rotate either.
B
4
Posts: 24
Reputation: 348

Post » Mon Oct 08, 2012 1:39 pm

One thing you have to get used to with C2 is that when you preview a game it's stored in the browser's cache. Most of the time it works properly, but every now and then you'll either have to clear the cache, close the preview window and run again, or hard reset the page so that the browser runs the updated version of your project, instead of the cached one.

If you're using the 8 Way behaviour (you haven't specified how you're doing things so I'm guessing) then you can disable rotating by changing the "Set Angle" setting in the sprite's properties.

For what you want to do with movement you could either leave the 8 Way behaviour setting "Default Controls" on yes or disable it and do the movement via events.

+ Down Arrow is down
- Set animation "yourAnimation"
- Simulate Control: Down (if you set "Default Controls" to no)
+ Else
- Set animation "someOtherAnimation"

To make the character stop without as much slide, simply increase "decceleration" until the character stops the way you want it to.inkBot2012-10-08 13:40:54
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Mon Oct 08, 2012 4:35 pm

Thanks for the info, it did help and work!

Now I have another problem- when I press any key, up/down/left/right, the proper animation occurs, etc. When I release the key, the animation stops and reverts to frame 0, which is good. However, if I press the same key again, the sprite will just slide along in frame 0.

For example, if I press right, he will turn right and do the running right animation. When I stop, he goes back to frame 0, slides for a little bit (which is what I want) and then stops. If I then pressed right again, he would just move in frame 0. If I then pressed left, up or down, he would do those animations as normal.

How do I set the animations so that they can repeat their function immediately after the key is released?
B
4
Posts: 24
Reputation: 348

Post » Mon Oct 08, 2012 10:00 pm

Properties bar, set looping to yes.

https://www.scirra.com/manual/48/image-and-animations-editor
B
73
S
20
G
10
Posts: 524
Reputation: 9,896

Post » Tue Oct 09, 2012 8:53 am

I have those set up already though. It won't do the animation the second time if a key is pressed twice in a row. If I press left/right and then quickly release it and press up/down (changing from a horizontal/vertical key to a vertical/horizontal key) sometimes the animation won't play at all, like I pressed the key too fast and the system didn't have time to react.

Also when I run the game, the running down animation plays automatically until I press another arrow key. Is there a common fix to this?
B
4
Posts: 24
Reputation: 348


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests