Skip to content

Instantly share code, notes, and snippets.

@ajweeks
Last active January 31, 2016 15:54
Show Gist options
  • Save ajweeks/40dd7546bb4ca1851be0 to your computer and use it in GitHub Desktop.
Save ajweeks/40dd7546bb4ca1851be0 to your computer and use it in GitHub Desktop.
Devember Sixteenth

Devember Day 16

We're officially past the half way mark of Devember! I spent around 2 hours today working on my programming assignments in class. This week we are covering "classes" once again. The first assignment is a simple bouncing ball demo type thing, like the one I showed on day 7, but this time using sprites. A ball is happy if it is the highest ball on the screen, it is scared if it is close to the edge of the screen, and if it is clicked on then it falls asleep - or wakes up. Otherwise, it has a neutral face. You can control how quickly they move around using the arrow keys.

The second assignment I worked on was a sort of color picker type thing. You can set the RGB values using three instances of a Slider class, and the size of a rectangle using a fourth instance. There is a tooltip shown when you hover over any slider that tells you some info. It uses a quite strange system, where the left mouse button selects the minimum value, the right mouse button selects the max, and the middle mouse button selects a value where the mouse is. Honestly I don't think I would ever use that system, but that was the assignment. I've never implemented a tooltip before, but it's actually a super easy thing to do, if you already know where the mouse position is and how to render to the screen.

That's it for now. I still have one and a half assignments to do, I'll probably end up doing them in one of the next few days.

Also - I may or may not have access to internet from December 20th until the new year, so I might have to wait to post my entries until one of the first days of January. I will try my best to write an hour of code everyday, and write a daily devlog as well, and I'm hoping I'll find some free WiFi zone somewhere.

Previous Entry | All Entries | Next Entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment