Sprite Won't Move

Just started using Construct 2? Post your questions here

Post » Fri Aug 28, 2015 5:32 pm

I made an event where if the F key is pressed, every tick the sprite moves forward a pixel, but the sprite doesn't move at all. Any help?
B
5
Posts: 18
Reputation: 269

Post » Fri Aug 28, 2015 5:56 pm

@Superpigy
Superpigy wrote:I made an event where if the F key is pressed, every tick the sprite moves forward a pixel, but the sprite doesn't move at all. Any help?

If you just used On Key Pressed, then this is a trigger and will only happen once. The every tick is meaningless in this situation.

What you probably want is the condition 'On key down'. The every tick would still not be needed.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,422
Reputation: 59,530

Post » Fri Aug 28, 2015 6:02 pm

zenox98 wrote:@Superpigy
Superpigy wrote:I made an event where if the F key is pressed, every tick the sprite moves forward a pixel, but the sprite doesn't move at all. Any help?

If you just used On Key Pressed, then this is a trigger and will only happen once. The every tick is meaningless in this situation.

What you probably want is the condition 'On key down'. The every tick would still not be needed.


Still won't work?
B
5
Posts: 18
Reputation: 269

Post » Fri Aug 28, 2015 6:46 pm

@Superpigy

You would make this a lot easier by posting your .capx.

Try the example attached: https://dl.dropboxusercontent.com/u/34306693/Egs4Users/moveblock.capx

Requires the latest stable release - r212.2.

Just run the preview and press the 'F' key to move the block right.

May I suggest you take a good look at the manual, and especially at some of the excellent beginner tutorials - you will learn much quicker.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,422
Reputation: 59,530

Post » Fri Aug 28, 2015 7:48 pm

Message: Superpigy is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
zenox98 wrote:@Superpigy

You would make this a lot easier by posting your .capx.

Try the example attached: Requires the latest stable release - r212.2.

Just run the preview and press the 'F' key to move the block right.

May I suggest you take a good look at the manual, and especially at some of the excellent beginner tutorials - you will learn much quicker.


II have looked at the manual and used the exact code from the game you linked, but as I stated before, the sprite just won't move at all.
B
5
Posts: 18
Reputation: 269

Post » Fri Aug 28, 2015 7:55 pm

My version (attached above) works. Does it work for you?

If not, then explain in detail what happens.

Are there any errors shown in the browser console?
What browsers are you trying?

If you attach a .capx of your work, then this will be resolved much easier and quicker.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,422
Reputation: 59,530

Post » Fri Aug 28, 2015 8:00 pm

zenox98 wrote:My version (attached above) works. Does it work for you?

If not, then explain in detail what happens.

Are there any errors shown in the browser console?
What browsers are you trying?

If you attach a .capx of your work, then this will be resolved much easier and quicker.


I'm using Google Chrome, and yeah the thing that you linked does work which is why I'm confused, how do you submit a .capx?
B
5
Posts: 18
Reputation: 269

Post » Fri Aug 28, 2015 8:27 pm

Can't figure out how to upload a .capx but this is the answer

Global Number "Movement = 0" 1= Move 0 = Don't move
System>>Movement=1 >>Simulate 8Direction pressing left
>>Everytick

Keyboard F is down >> System Set movement 1
Keyboard F released >>> Set movement 0

Full details:
Basically what your doing is when you are holding down F your setting a global value to 1 then when you release the button your setting it back to 0.

Since 1 means to move left and 0 means to not move the system works.

Just make sure the first system has a Everytick.
B
23
S
8
Posts: 115
Reputation: 2,640

Post » Fri Aug 28, 2015 8:31 pm

@Taser

That seems like quite a pointlessly over-complicated way of doing something that is so simple, and doesn't seem to relate to the OP question at all.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
86
Posts: 5,422
Reputation: 59,530

Post » Fri Aug 28, 2015 9:24 pm

zenox98 wrote:@Taser

That seems like quite a pointlessly over-complicated way of doing something that is so simple, and doesn't seem to relate to the OP question at all.

How doe's it not relate to the question, he wanted to know how to move a sprite every tick so I gave him a way. It might be complicated but it's a Answer to the question. Also I'm not posting for you, I'm posting for him so that he will have an idea of a way in which it could be done. Obviously the best way would be
keyboard F down >> 8 direction move left. :\
B
23
S
8
Posts: 115
Reputation: 2,640

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: brunopalermo and 3 guests