Making a game

Hello

Can someone please explain how can I program the arrow keys in wick?
Also I am trying to create a game where I shoot a ball into a net. How do I begin.

Thanks

2 Likes

Hi Sofia, programming the arrow keys in wick is pretty simple.
put this code in the object you want to control

function update() {
if(keyIsDown(‘UP’)) {
this.y -= 3;
}
if(keyIsDown(‘LEFT’)) {
this.x -= 3;
}
if(keyIsDown(‘DOWN’)) {
this.y += 3;
}
if(keyIsDown(‘RIGHT’)) {
this.x += 3;
}
}

You can change what keys you use by replacing words such as RIGHT and LEFT with A and D. or any other key that you want to use.

Hope this helped

1 Like

I’m not sure I know how to answer your second question. I’m not the best programmer. Someone else will figure it out for you.

I am still having problems

Are there any tutorials?

This YouTube tutorial, uploaded by Luca Damasco, the co-founder of Wick Editor, shows how to use keyboard controls for your Wick Editor project. https://www.youtube.com/watch?v=mpJOY1-qshU

there are many way you can do it
one of the simplest would be to make a set of animations with different ball shots and play one of them based on the point of the ball where the player clic on
other more complex methods imply the use of some physics to actually emulate the real ball behaviour