Archive

Please reload

Tags

Please reload

Circles

February 25, 2018

It's really too long since I've posted, or really even done any coding. I can make a lot of excuses why I haven't had time for it, but what's the point of that. I have a few minutes now before bed and rather than rationalize my lack of progress I want to take a small little baby step forward in my learning. I saw a video a while ago and it seemed cool so I will use what I remember from it as inspiration (I won't watch or reference the video tonight, but it's here if you are interested). I'm going to write this post and write the code at the same time and try to share the process. We'll see if this works.

 

11:25 Plan - Draw a circle that grows.

11:39 Success - Very basic but I was distracted because I wanted to screen record and convert to a animated GIF so you could see the animation here. Future Project! Stick to the Plan!

 

11:41 Plan - Draw two circles in random locations.

11:45 Success - One in original center. The other at a random location.

 

Next Step - Make the circles into a circle class.

 

11:56 - Back to one circle. I forgot how to create a class function and had to look at an old project I did before. Now on to the second circle.

 

12:09 - Change of plans. I decided to create a grow function first and an isGrowing function to stop growth. Growing is working but not stopping. Back to the code

 

12:13 - Ok. Fixed the problem by having the grow function do the checking rather than a separate function. I was having trouble getting the isGrowing function to return a BOOL.

 

12:14 - Create an array to hold the Circles and add a new circle each frame. I forget how to add to an array but let me see if I can remember. 

 

12:22 - Had to look up the "add to the end of an array" function, it's array.push(). Now I have infinite circles being drawn and all stopping their growth at 100 pixels.

 

Not really a finished project. But it's learning. Doing. Creating. Action. Working. It's a step forward with less than an hour. I'll keep going with this the next time I have a few free minutes.

 

 

 

 

Please reload

Recent Posts

Please reload

  • White Instagram Icon

©2017 by Dan Varney