Wednesday, 29 February 2012
Poing
Last weekend I made a vector class, though it didn't support dynamic vectors. Thus, I threw together some extremely bad code to remake the vectors for the paddles every cycle. This worked well enough, but the hit testing on the sides of the paddles is extremely inaccurate. Generally I have enjoyed this project, having more involved labs I find to be much more enjoyable than the simple ones we have had in the past.
Wednesday, 22 February 2012
Vectors!
Last weekend I derived an equation to find the distance from a line to a point and implemented this into an algorithm in a vector class. In order to do this in an appealing way I taught myself about nested classes (quite simple) and Image IO. (Although I couldn't recite the code, this also proved to be fairly simple.) Currently I'm trying to figure out how to make an efficient and simply way to present a class that will run saving the vectors and generate a corresponding image to run alongside the vectors, with my goal being making a randomly generated top-down game.
I don't have any major commentary on the class except that some of the worksheets did seem superfluous, though I did get a fair amount of the questions wrong so I can't honestly present any criticism on the issue.
Wednesday, 15 February 2012
Late late post
Last week we learned about inheritance, interfaces, and static classes. These are three things that I have wanted to have formally explained to me for a while, so these presentations were fairly interesting. However, the worksheets felt extremely repetitive; Some of them were the exact same code as another worksheet but with different variables.
Other than that, the labs seem to be getting harder, which is nice as they can serve as more than 30 seconds of quick coding. That being said, I don't see a reason that, at this point, the class can't just write the code entirely from scratch rather than using partially prewritten classes. The only thing that was necessary for the pong lab that hasn't been taught yet was graphics, and it wouldn't be hard to provide a graphics library.
Monday, 6 February 2012
Arduino
This week we reviewed oop, nothing I can comment on there.
SO I got an electret microphone with the intent to use it with my arduino, however I found that my arduino would not pick up the signal from the microphone if I hooked the mic up the same way I would a button or photoresistor. Thus, I did a little more research and purchased a 386 amp to amplify the signal, as well as capacitors and resistors to regulate the voltage. The arduino is now picking up the signal to a degree, though it still is not responding to sound. What I did notice, after reading the datasheet, is that the mic gives the raw audio waveform, with values alternating and varying 0 to 100 or so.
Subscribe to:
Posts (Atom)