Pls help (10 c)

I’m making a game but I cant Macke a wall

could you perhaps provide slightly more info as to what you are doing? it’d be really helpful to determine how we can help you make a wall of any sort.

like, are you making a platformer? car game? is there gravity?

Easy:

// wall default script
if(!project.walls)
  project.walls = Object.create(null);

project.walls[this.uuid] = this;

// player update script
const lastX = this.x, lastY = this.y;

// movement...

const touchingAnything = Object.values(project.walls).filter(c => this.hits(c)).reduce((acc, cur) => cur || acc);

if(touchingAnything) {
  this.x = lastX;
  this.y = lastY;

This code does:

  1. Save the last ‘good’ position
  2. Movement code (you know how to do that)
  3. Calculate if touching anything
  4. If actually touching anything, revert to last ‘good’ position

what??? :sob: @noobfield really is a wizard, i didnt even know that was possible…