Sunday, November 10, 2019

Project 20 - That Code Click - Introduction

I like it when things click. When I’m programming I love that moment where things go together perfectly, and I love that moment in my own brain when a topic suddenly snaps into focus. I also like when I’m working with students and I see that moment for them.


This next project is my attempt to share that feeling and to help people learn about all of the stuff in computing that I think is really cool. It’s a chance to look at how things work, how things fit together, how things were designed and how those elegant moments in problem solving come to be.

I hope this is a chance for me to stretch my writing, teaching and communication skills. Additionally there are a lot of other technical skills I should pick up such as video production and things like that. It’ll also be a nice chance to chase down those topics I’m interested in, but never really have the time to manage while I’m teaching (and then forget about when I’m not teaching).

For the short term I’m going to simply create a few written articles and upload them here while I start building out the idea. In the longer term I’d like to see a blog and then maybe a fully dedicated website to host those articles and other supporting material.

For this first iteration of the project, I’m planning to write one article on “Counting in Binary on Your Fingers” a fun trick I always enjoy using to introduce binary numbers. I’d like to get that finished some time before November 29, including text and my own photos to illustrate. I'll also put together a list of future topics I'm thinking of. If you happen to have a great computing "click" you'd like to suggest, let me know.

Sunday, November 03, 2019

Project 19 - Pong - Phase 1

Project 19 - Pong

I am implementing Pong. Yes, that Pong. I’m implementing it both for fun, but also because it’s going to be necessary for a project for work in the fairly new future.


I figured since I was implementing Pong, I might as well make a project out of it. As a bonus since my implementation is basically finished, I get a free finished project out of the deal.

I decided, as is my wont, to work in Processing.org. This is pretty much my go to platform whenever I need to prototype something or do a thing with quick interactions. I’m also educating myself about P5.js which is proving to be fun as well.

My original take was to work with vectors, which has exposed me to all of the linear algebra I didn’t learn or have forgotten. This will also be helpful for my Bubble Puzzler work (which apparently I haven't updated here, to my surprise). I then remember that my Phase 2 for this project is to have a working version of Pong on the Atari ST, and so I’d be better off handling things like coordinates and motion as simple variables. You can find the source in on GitHub.


// player positions on the screen
int p1Y;
int p2Y;
int p1X;
int p2X;

// paddle display information
int paddleW = 10;
int paddleH = 75;

// player scores
int p1Score = 0;
int p2Score = 0;

// ball position on the screen and motion
int ballX;
int ballY;
int ballMoveX;
int ballMoveY;

int ballSize = 10;

Within the program my code is fairly basic, I’m relying on processing’s control of the framerate, and basically assign the ball a speed between 2 and -2 on the y axis and 2 and -2 on the x axis. This feels like a fairly workable implementation of speed, although increasing it as the game goes on would be an option (I suspect an actually competitive game would go on for quite a while).

The ball bounces off the top wall and off the paddles. If the ball hits a paddle near the edge (about 1/8th of its total length) then it bounces in the y direction as well as the x.


void bouncePaddle(int paddleX, int paddleY) {
    // bounces the ball off the paddle 
   if (((ballX + ballSize >= paddleX) && (ballX <= paddleX + paddleW)) && 
              ((ballY + ballSize >= paddleY) && (ballY <= paddleY + paddleH))) 
        {
     ballMoveX *= -1;
     
     // reflects the ball back on the y axis if it hits near the edge of the paddle
     // mostly for fun, not sure it was in pong, but I enjoy it in most clones
     if ((ballY + ballSize < (paddleY + (paddleH / 8))) || 
         (ballY + ballSize > (paddleY + 7 * (paddleH / 8)))) {
       ballMoveY *= -1;
     }
     
   }
   
}


This produces enough interesting effects that I’m calling this phase of the project done.

That being said, in the short term, I suppose I need some more inputs because solitaire pong seems not-too much fun. Beyond that I think that’s probably it for the Processing.org implementation. My next priority is to prepare to produce the Atari ST version of the game. I would also like to produce a version of Breakout because that seems fun and possibly also add in a few interesting visual effects.

I should be done the AtariST version by early January because I need my students to start on their projects by then.

Tuesday, October 29, 2019

Blog: Games of September 2019


September wasn't too exciting. I'm continuing my march through Three Houses, (2 endings down, 2 endings left) and I've started playing a little Dragon Quest XI. Other than that I'm trying to find a good balance between productivity, gaming for relaxation and gaming for excitement.

My top five games (by play time) for September were:
  1. Fire Emblem: Three Houses - It keeps going and going ... *Pink Rabbit Rolls Through Banging Drum*. This game could have turned into a total slog, but the actual game play has been fun enough that I've always been pretty happy to fire it up. Additionally the different stories for the three houses has made it really interesting to keep going. I'm planning one more play through now to finish the last ending. I'm also thinking of another play through to do some kind of 'perfect play through'.

    I think this is her problem summed up really.

    For my third play through I moved the difficulty back down so that I could play a little faster. I'm also playing the Black Eagles now, and I'm trying not to recruit any PCs from other houses (I did pick up a few, but just to ensure I have enough bodies on the field for the bigger missions). I really appreciate how different the Black Eagle story and missions are. I was a little disappointed with the similarities between the Golden Deer and the Blue Lions.

  2. Dragon Quest XI - I'm really enjoying Dragon Question XI. It brings back a lot of the things I've enjoyed about other DQs and it's refreshing. I think Tim Roger's review sums it up best for me. This is a game you can play at an easy pace, and just drift into it. There's enough game to keep me engaged, but not so much that it requires my full attention.

    And I've never been happier.

    It has some nice quality of life improvements over previous games. The ability to run quickly is nice (as is the collection of speedy mounts you can pick up. I've ended up adjusting the combat back to pretty standard for Dragon Quest, but I appreciate their attempt to spice up the combat and further the fact that I *could* switch it back. I'm looking forward to this as a nice long story with some funny accents and swords and magic.

  3. Super Mario Maker 2 - I haven't really gotten into SMM 2 the way I did to the first one. I'm not quite sure what I'm missing because they've made a lot of nice additions to the game. I think it may just be that my creative energy is pointed elsewhere right now. I also feel like the increase in quality of levels and the increase in styles/tools has resulted the levels feeling a little more standardized. I'm still enjoying it, but it hasn't been a must play.

    Fight!

  4. Animal Crossing: Amiibo Festival - Our weekend standard continues. We're thinking we'll substitute in New Horizons some of the time when it comes out, but Amiibo Fest has been an important part of our quite time.

    Checking out the scores.

  5. Super Mario World (SNES on Switch) - This is the *weirdest* Super Mario Maker game. I think of the 2D Mario's this my favourite, but playing it again with the SNES online service, I'm struck but just how weird it is in comparison to all the other games. I've maybe played more of this game then any other (It's the very first game I bought for myself) and I've enjoyed picking it up again. In light of Super Mario Maker and a lot of common 'rules' for level development it feels very different, sometimes it feels unfair or weird, but generally I think it's fun. It's also a hefty dose of nostalgia.

    I'm amazed at how it feels like this game comes right out of the screen.



Here's my total play time chart for September:



And here's a chart of how much I've played over the month:




Project 24: Blog HTML Generator - Introduction

 I’ve been having a lot of fun with my new book tracking infographic. Doing things like making a word cloud of authors and a grid of titles...