Adventure style of game help needed

What Wick Editor Version are you using?
Candlestick V.1.0.1

Describe the Problem
I was trying to learn how to make a type of game where you use arrows keys (and wasd keys to move around the player. (It’s a adventure style game) I did make code for movement of the player and I just need help with the collision if the player hits the wall.

What have you tried so far?
multiple attempts at coding…

Do you have a Wick Editor File that we can see? Optional*
examplewallhitplayer1-15-2026_0-54-43.wick (59.9 KB)

(If theres any issue with the player because of the walking animation then It’s fine without the animation.)

Hey @UnkLos_Us,

Cool stuff so far, I thought it was smart how you’re using keyboard events inside your player Clip to control the walking animations!

For collision detection with walls, you have lots of options, and things can get complicated fast. For a small top-down game, I would keep it simple. Here’s what I’d suggest:

There are four “versions” of each wall piece. Essentially, each one “pushes” the player away in the opposite direction. So, the top wall moves the player down, the bottom wall moves the player up, etc.

For example, here’s the top wall Clip’s code:

if(this.hits(player)) {
    player.y += player.speed;
}

To make this work, you’ll also notice I updated the player to store it’s speed variable in this so it’s accessible from the wall Clips:

this.speed = 7;

if(isKeyDown('left')) {
    this.x -= this.speed;
}
if(isKeyDown('right')) {
    this.x += this.speed;
}
if(isKeyDown('up')) {
    this.y -= this.speed;
}
if(isKeyDown('down')) {
    this.y += this.speed;
}

Let me know if you have any other questions! happy to help.

examplewallhitplayer21-15-2026_4-47-20.wick (62.2 KB)