jlpt

Members
  • Content Count

    2
  • Joined

  • Last visited

About jlpt

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. jlpt

    Difficult game i made

    I want to know your opinions about my game https://jlpt.itch.io/iwannabethecube controls arrow keys or wasd to move and C to dash note: you need to use chrome
  2. I have a function which detects collision but when the player is moving too fast or if it is too small or both, the player clips through the wall. If i can have help on how to improve/change/redo the code to make it work at higher speeds and when the player is smaller function checkPos(obj1,obj2){ if (obj1.x < obj2.x + obj2.width && obj1.x + obj1.width > obj2.x && //COLLISION FROM BOTTOM obj1.y < obj2.y + obj2.height && obj1.y + obj1.height > obj2.y) { if (obj1.x > obj2.x+obj2.width-(player.speed*2) && obj1.y + obj1.height > obj2.y+player.speed*2 && obj1.y+player.speed*2 < obj2.y + obj2.height) { // hit a block on the right obj1.x = obj1.x + player.speed } if (obj1.x+obj1.width-(player.speed+4) < obj2.x) { // hit a block on the left obj1.x = obj1.x - player.speed } if (obj1.y > obj2.y+obj2.height-(player.speed*2) && obj1.x + obj1.width > obj2.x + player.speed*2 && obj1.x+player.speed*2 < obj2.x + obj2.width){ // hit a block on the bottom obj1.y = obj1.y + player.speed } if (obj1.y+obj1.height-(player.speed*2) < obj2.y){ // hit a block on the top obj1.y = obj1.y - player.speed } } }