Wednesday November 29th

Functionality and Bugs

Continuing onward…

  • I was able to continue working a bit on my game, and I hit a few issues / things to work on:

    • collision (need to figure out) with ground and player. The issue is that my ground is not currently in a class, but the player is. I was thinking of just checking also that it (the player) is a certain Y-axis and have that as the threshhold. I’m still thinking it through. I am thinking I have to somehow get the Bounds of each object and check to see if they intersect, and then go from there. Apply some sort of force back or change the speed…something. Working on that.
    • I also tried a .wav file today via their loadFile. If I add sound, the functionality slows down. Ack! Not good. I don’t currently need sound, but I set up the function and tested it, so that’s something to be aware of, moving forward.
    • I was also able to set up a pause function. Wasn’t too bad, even though of course, I can work on it some more.
  • Once I figure out collision, I can start to work on jumping/ physics

  • When that is done, I need to work on possibly atmosphere, but I don’t know if I’ll have time for that within the bounds of the class. I figure I can continue on my own, in any case :)

Learned about

  • AABB collision vs Pixel based collision. There is a really interesting book I’m looking at, also, in general, on Game Patterns. I think that sort of stuff in general is really helpful. Yep, I know I mentioned it before. Broken record here (it me) :)

And…

  • I’m also really excited for next week, even though it looks like I’ll be missing quite a bit of talking from some people with some really cool titles :)
  • That’s it for now. I have class tonight, so get home late and all that, pretty much!

Oh…

  • I’m starting to mentor a person or two (??) from tomorrow; I heard it starts from then.
  • I also am supposedly house-sitting sometime in December. I’ve never house-sat before, but I heard that there are dogs, so that makes it perfection (well, that and wifi).

Katas

  • create rectangular pattern given *, width and height
function rectangle(char, width, height)
{
  var arr = []
  var x = (char.repeat(width))
  //console.log(x)
  for (var i = 0; i < height; i++){
    var z = (x)
    arr.push(z)
  }
 
  return arr.join("\n")
}
  • power without Math.pow
function power(x,y){
  var mult = 1;
  for (var i = 0; i < y; i++)
  {
    mult = mult * x
  }
  return mult;
}
  • celsius to fahrenheit. If not num, return undefined
function celsiusToFahrenheit(celsius) {
  if (typeof(celsius) === "number")
  {
    var fahrenheit = (celsius * (9.0/5)) + 32.0
    return fahrenheit;
  }
  else
  {
    return undefined;
  }
}
Written on November 29, 2017