Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Chapter 1 of what I hope turns into a book. — Gideros Forum

Chapter 1 of what I hope turns into a book.

MagnusviriMagnusviri Member
edited March 2012 in Step by step tutorials
I've been writing a book for teenagers who have no programming experience. I've written a bunch of chapters and decided t was the wrong approach so I've started over and I think I like this.

http://magnusviri.calepin.co/mobile-game-programming-chapter-1.html

This is my rough draft for chapter 1. I plan on taking this page down after a week or so, but I wanted to post it and ask other's if they could take a look at it and let me know what they think of the idea of this being a first introduction to programming.

I started having doubts about my previous chapters because they were all about basic programming principles: variables, loops, data types, etc. I tried to teach a class last year with this as the main emphasis and it didn't go as well as I would have hoped. So I started having doubts about what I was doing and then I ran into this blog post that pretty well convinced me to start over so I did.

If you can let me know what you think in this thread I'd really appreciate it.

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Hello,

    well that seems very nice, maybe soemtimes even too philosophical for developers. :)
    I was taught about variables, as boxes where you put something in, but so you won't forget where you put what, you write names on the boxes as variable names. But your idea is also great, and gives new concept I've never thought before.

    What kind of children are you teaching? From my experience, not everyone can learn to program. Here in Latvia, we have a big deficit of developers, so programming is now part of a High School education. In university, Computer Science faculty is the only one that is completely free, more budget places than students. That is why anyone, who wants to be a student, and don't know what to study, goes to Computer Science. And it's been a nightmare for them.
    I didn't know anything about programming when I came to university 4 years ago, heck I got my first PC only 8 years ago, but I still managed to grasp all the concepts to study through, and could never understand why so many failed.

    It's simple, programming is not for everyone, no matter how you teach them.
  • LOL, I'm pretty philosophical. I actually took out a few paragraphs that started to go overboard.

    I know the variable are boxes way of teaching but that makes teaching pointers later on really hard I think. At least it was really hard for me to grasp pointers until I quit thinking of variables as boxes but just a way to get to the boxes. I think it's easier to teach pointers by just calling variables names, or labels. And in Lua, it's especially true because now functions are variables too.

    I'm going to be teaching 13-17 year olds. I sort of agree that not everyone can learn. But I'm not sure if the limitation is because of ability or life circumstances. With enough desire and opportunity I think anyone could learn. But most people don't want to learn, and even more people lack the opportunity to learn.

    I think most kids want to make games because as one kid said to me last year he thought making a game would be like playing a game. Thinking like that makes sense in a way. And I think the irony is that unless making games is fun for young kids, they aren't going to want to learn.

    Ok, did I mention I'm philosophical? I wrote these next few paragraphs and they are exactly the type of thing I normally delete because it gets too off topic. But I thought I'd leave it in because I am showing off how philosophical I can get just talking about programming...

    I know in America that a lot of the things taught in school are simply to get people ready for a small sampling of specialized careers and the reason they teach it to young kids is because they have to start teaching that early or there wont be enough young adults later in life to find the ones who can really do the job. And for everyone who doesn't get the job, well, they wasted most of their youth learning things that they will never use.

    Except that learning is a skill, and so I think it's not entirely wasted. But I studied to be a music composer but I was learning at a University, which teaches a music style that doesn't pay any bills. So while I know how to write music, I don't have much experience writing music people will pay for, so therefore I spend my time doing things people will pay for, and I don't get better at writing music.

    Except I did learn how to learn. And I've heard that a career in computer programming is like being in school the rest of your life because you are constantly non-stop learning. Oh, did I mention I work at a school for my day job? So I really am spending the rest of my life in school. LOL. If that doesn't make your head spin I didn't do my job. ;)
  • Ok, the reason I should've deleted those last few paragraphs is because I was only talking about myself and I missed a better topic. I forgot to say that having a free computer programming education certainly sounds unique to me. I can't really imagine it. I can't really imagine having a huge group of people who default to learning it because it's free.

    I think the thing is that for me, I'm drawn to programming because it's something that fascinates me. I have to be honest, I'm not a game programmer. I have a few games on the App Store but they are nothing like what I really want to do. Maybe one of these days I'll make a game that I'll think qualifies as enough of a game that I can claim to be a game programmer. But to me, a game programmer has less to do with reality and more to do with my imagination.

    Being a game programmer is a dream I've had since I was a little kid. I still don't even know what this dream is, or if it is good. It has kept me fascinated by computers, and that gives me the motivation to keep pushing forward and learning more and more, and that gives me a good enough job and I spend my free time pursing my dream.

    I think that is all I'm trying to give other people is a fascination and desire to learn. I can't imagine doing any of this without that fascination. This stuff really sucks and is a lot of mostly fruitless work. Without the fascination I can't imagine it being worth the work for anyone.
  • Your chapter is a good read and I give you credit for taking on such a task. I have just finished writing a book for beginning game developers and for sure it was a long and windy road. Good luck and even if it becomes "work", keep going on and push yourself. One time you will reach the goal line. =D>
  • ar2rsawseenar2rsawseen Maintainer
    edited March 2012
    Well, the problem with teaching game development is that you'd need to get to some difficult concepts pretty fast, as object oriented approach etc. But on all the way you need to learn basics too, as variables, ifs, loops, etc.

    So while your intention would be to teach creating games, it would take a lot of time, to get to that point, when you actually can make one.

    Unless these games, ar not graphical, but console based, like "Guess the number".

    For me, it was pretty cool, that I could apply programming to solve my daily tasks. You know, for example, math homework. It is possible to write one program, then by inputing different parameters, solve many similar tasks.
    Or I was learning to play guitar, so I wrote a program to convert melodies from notes to guitar tabs.

    But mostly used for solving mathematical tasks.

    Though I remember one interesting task, not really related to math. Write a program, which asks user 3 questions with yes or no answers, and after these 3 questions, program outputs month when your birthday is. That was pretty cool.

    Oh and yes, there was one interesting language for graphical programming for begginners called "Logo" (aka Turtle graphic). Basic concept is that you have a turtle, and then you navigate it like, draw 100 (means drawing 100px forward), turn left, turn right, etc. That was also pretty cool.

    Edited:
    Remembered, that I even wrote Interpreter for Logo in JavaScript
    http://webcodingeasy.com/JS-classes/Canvas-Turtle-graphics-using-javascript
  • This is the blog post that I read that convinced me what attitude I needed to have.

    http://inventwithpython.com/blog/2012/03/03/nobody-wants-to-learn-how-to-program/

    His third point, that beginner programmers are plagarists is very true with me. I remember too well the games that I tried to hack as a kid. Part of the fun was figuring out how the games worked. Most were machine code (from the magazines) and I remember when my brother figured out what to change to make custom maps for a game similar to Donkey Kong. It was such a simple game now that I think about it, but I was so obsessed with it. I'm not even sure the game play was that good.

    I've read another blog post that kids are a little too imaginative, that one kid played a video game and told his dad an entirely made up story to the game. I remember being that imaginative and I'm hoping to play off of it as well but with teenagers I'm not sure how much will be there.

    Another idea I had is to not try to teach programming concepts but to take concepts that are already familiar to kids and then emphasize that those are concepts that computers understand, like storing data, loops, questions, etc.

    I remember Logo. :) And I remember drawing a lot. I'm going to focus on drawing, so no console based games. I plan on doing something text based for my chapter on strings though. I've already done guess a number and tic tac toe graphically in Gideros and they are not small. I decided tic tac toe was better for chapter one.

    And funny that you mentioned doing math. I've said that to kids before and I decided that would be an excelent example for my 2nd chapter on numbers. This is the more advanced example that draws a cartesian coordinate system and a quadradic equation with a z that is based on time. It's heavy on drawing.
    local width = application:getContentWidth()
    local height = application:getContentHeight()
    local scale = 30
     
    -- crosshair
    axis = Shape.new()
    axis:setFillStyle(Shape.NONE)
    axis:setLineStyle(1,0x000000)
    axis:beginPath(Shape.NON_ZERO)
    axis:moveTo(0, height/2)
    axis:lineTo(width, height/2)
    axis:moveTo(width/2, 0)
    axis:lineTo(width/2, height)
    for xx = 0,width/2,scale do
    	axis:moveTo(width/2+xx, height/2-3)
    	axis:lineTo(width/2+xx, height/2+3)
    	axis:moveTo(width/2-xx, height/2-3)
    	axis:lineTo(width/2-xx, height/2+3)
    end
    for yy = 0,height/2,scale do
    	axis:moveTo(width/2-3, height/2+yy)
    	axis:lineTo(width/2+3, height/2+yy)
    	axis:moveTo(width/2-3, height/2-yy)
    	axis:lineTo(width/2+3, height/2-yy)
    end
    axis:closePath()
    axis:endPath()
    stage:addChild(axis)
     
    -- line
    line = Shape.new()
    stage:addChild(line)
     
    -- equation
     
    function fy( x, z, scale )
    	local x = x/scale
    	return (x+2+z/100)*(x-2-z/100)*(x+z/10)*z*scale/100
    end
     
    function draw_line( width, height, scale, zz )
    	line:clear()
    	line:setFillStyle(Shape.NONE)
    	line:setLineStyle(1,0x0000ff)
    	line:beginPath(Shape.NON_ZERO)
    	for screen_x = 0,width,10 do
    		xx = screen_x - width / 2
    		line:lineTo( screen_x, height / 2 - fy( xx, zz, scale ) )
    	end
    	line:endPath()
    end
     
    local zz = -scale*3
     
    local function onEnterFrame(event)
    	draw_line( width, height, scale, zz )
    	zz = zz + 1
    	if zz > scale*3 then
    		zz = - scale*3
    	end
    end
    line:addEventListener(Event.ENTER_FRAME, onEnterFrame)
  • ar2rsawseenar2rsawseen Maintainer
    Still it's all based on enthusiasm of kids. Are they willing to learn or not. But, yeah it's a novel approach for me, so have no idea how will it go. Keep us posted on the progress. ;)
Sign In or Register to comment.