Skip to content

#FLmobigame – Week 3

Tue 25th March 2014

End of Week 4 and I’m just starting Week 3 🙂 If it’s similar in weight to Week 2, I should be able to get through it today (if I get done the thing that’s been sitting on my todo list a few too many weeks)!

My in-ear headphones are broken, so currently I can only listen to the videos in private, which is causing enough friction to make me not do it. I’m also struggling with the massively different weighting of the videos. I’ll finally sit down to watch a video and find it’s only 1 minute long, and then there’s 5 pages of text to read, which I could have been doing all along. Then I’ll try to catchup in a spare 10 minutes and hit section 3.2 which is a 20 minute video! It would be nice if the weekly summary page had an indication of the length of videos and amount of text in a section. That or they were weighted a little more evenly.

The first error I found (making the bounding circle incorrect)

The first error I found (making the bounding circle incorrect)

The long video describing how to break down the problem of keeping the ball on the screen is extremely well explained, and wonderfully paced. I’m not sure it needed to fix the problem of half the ball going off screen, possibly leaving it as an exercise for the reader or another video. I’m also surprised that the co-ordinates and speed of mBall are in dedicated variables, but the width of mBall are retrieved with a getter method (mBall.getWidth()). I guess this is because mBall is the image, so getWidth() actually depends on the size of whatever file is loaded. Nice video though.

Several more long videos (well over 10 minutes) in this week.

The second error I found (meaning the ball was deflected incorrectly once collision was detected)

The second error I found (meaning the ball was deflected incorrectly once collision was detected)

Trying to get my smiley face to bounce the ball back was proving difficult, but it was very late at night and I was falling asleep at the laptop. The next morning I figured it out. It was a double bug; beginners beware this is a common occurrence! Often after you’ve written some code that doesn’t quite work as expected, you double check you logic. The thing is that in trying to find the root cause you will sometimes find other defects in your code. You fix this, then re-run your code and it still doesn’t work as expected. Don’t be demoralised! If that piece of code logically needed to change, then leave it in its now correct form. It just means you made 2 (or more) mistakes when writing the original code. Continue hunting, find the other one(s) and you will eventually get your code working.

Only a couple more things to do, so I might as well finish them up now. I’ve implemented a bit of code that should make the speed increase after every 2 paddle collisions, though it doesn’t have a visible effect. I’ve done it a simple way to test, so I’ll go back and do it properly (with Pythagoras) later.

I like how this week’s steps have loosened the reins a little. There has been far more freedom to write my own code, which is motivating. I imagine it has been a bit trickier for some people though? There’s some very smart questions in the discussions though: people appear to be trying to help themselves first, before asking for help (which isn’t always the case with beginner programmers)!


From → MOOCs, Programming

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: