Friday, May 15, 2015

Working More on Collision Detection (5/15)

Today I worked more on collision detection. I couldn't quite get it working, so I posted a StackOverflow question and pretty much continued attempting different functions all of class. Nothing has worked so far, but I'll continue trying and see if I can figure out the source of the problem. Once I can fix this bug, I can get back to feature adding!

Unfortunately I don't have any good step-by-step tutorials for today, but once I get collision detection working I'll be sure to add that in. Some of the recommendations for collision detection I've heard of are quadtrees and other Javascript libraries such as three.js. I haven't really used three.js however, because that's mainly for 3d rendering in Javascript.

EDIT (5/16): I finally got collision detection working! It wasn't anything to do with using the right algorithm, rather I had been passing an integer into my method instead of an array. It works great now! I'm now going to get started on velocities.

I also helped Aki on the tutorial today, so here's a link to his blog.

1 comment:

  1. So a quadtree is a *data structure* (see http://en.wikipedia.org/wiki/Quadtree), which is the very thing you are supposed to be studying in 2nd semester computer science. A really good post about quadtrees, including an explaination of the theory behind them and why they would be effective in collision detection, would go a long way toward helping you develop as a serious programmer.

    ReplyDelete