Friday, 31 August 2012

Programming for beginners – part 4

programming for beginners - RAM I hope everybody understands my previous posts. If not please let me know what is not clear and I’ll try to clarify.

What you see here is the actual MEMORY. I don’t want to get to technical so I’m just going to say that inside of these little boards resides the information that we are going to work with.

How? we don’t care for now.

Remember last time we were talking about boxes, and variables. So to recap from last week, a ScreenshotSmallvariable is representation of a container, such as a box. It holds information: numbers, names, dates, images, sounds, music, etc. In our case with MINIFONO (or Candy Toy phone) we have a screen where we have all the buttons that represents the numeric pad of a phone. Each of these button’s has different attributes: size, image, location and is tied to a specific functionality, more on that later. For example the number one is a button that has an image attached to it. It also has a position on the screen. A size. So we can say that there are several variables assigned to button number one.

And because there are several of these variables or boxes it’s a good idea to go to the hardware store and buy a bigger box to hold all these variables together. But first let’s define what we know now. And here comes the part were we actually code. In LUA we do it this way.

local buttonOne   <—here we name it, we create the box but we don’t assign any value yet

And since we came back from the hardware store with a bigger box we are going to use it for buttonOne. In it we are going to store the image that was created previously. Like this:

buttonOne = display.newImage(“buttonOne.png”)  <—that’s the way you do it in Corona SDK, more later.

buttonOne now has become the bigger box that will from now on contain the other attributes we discussed just now. In the next episode we will assign the size, the location on screen, etc.

Friday, 24 August 2012

More programming for beginners – part 3

Guess who forgot to post!

Anyhow let’s get to this week’s lesson: Variables!

I know it doesn’t sound fun but this is a very important concept. So what is a variable? Is a tag, or a box that contains information in it.

Let’s say we need to add 2 numbers and show the result. So we ask the user for the first number and STORE it in the first box, we call this first box, let me see what could be an original name? How about BOX1, now my brains are melting.

Let’s call the second box BOX2. In box2 we store the second number but wait we still need a third box, in this one we need to store the result of the adding operation. We call this box resultbox. Do you follow me? And then we tell the computer to add, we do it this way:


Voila! So now we have the result in the variable called RESULTBOX, was that easy or what?

But why is this important? Well we now see a very simple example with 2 numbers and with a simple operation, but what if we had to do different operations? We’ll save that for later. For now we need to understand that a variable is a box that contains data. You need to know something more, this box is a representation of actual computer MEMORY.

I bet you went to the store one day and the guy talked to you about memory and ram and gigabytes, well next time I’ll explain that too!

See ya!

Thursday, 16 August 2012

Programming for beginners – part 2

And here we are again, thanks for coming back!.













Thursday, 9 August 2012

How to start programming for beginners

images I previously made a tutorial about how to make an iPad eBook, but, I received several comments saying that those tutorials are a little too difficult for someone who doesn't have any previous experience; so I decided to start from scratch and make a tutorial for really really beginners.

In other words, if you already programmed then this tutorial is not for you. On the other hand if you don't have any idea but you have a passion and you are willing to study and practice then this is for you.

I used to teach basic computer skills in the 90's and frequently found people who never ever touched a keyboard, so I designed ways to explain programming using some examples and analogies. At that time I used to ask this: What is a programmer? Do you have a washing machine at home? If so then you are a programmer already! Let me explain. A program is a series of steps that a computer has to follow. In this case a washing machine follows a series of steps such as, wash, rinse, etc. If you can see this then you are almost there.

Now you say that's really easy to see but how do I make a game such as Plants Vs Zombies? Whoa, hold on there! You need to start small and gradually get into more complex things. Think about this, what you see on your monitor is just a dot of light. Or should I say millions of them. That's all. You just interact with them via several different ways such as: keyboard, mouse, finger, etc. Those points of light on your screen are called pixels. Order them and you get an image. Presto. Then you can tell the computer to move that image. Or perhaps rotate it, or detect if it collided with another image. You see we start building the concepts little by little.

And this now looks more like an introduction to a book, and who knows maybe in the future it will be. For now let’s just get started.

So, we need to know how are we going to tell the computer what steps she needs to follow. But wait, is there a dial similar to a washing machine one? Nah. If there was one then computers would be very limited. So instead of a dial we have a keyboard. With it we can enter instructions. A set of instructions becomes a program. Easy right?. And a set of programs becomes an application, such as Word or Excell.

What we really need to do now is learn the language the computer uses;  what kind of structures we need, what kind of things or commands the computer is capable to perform. For instance, we would like to display a word or a sentence on the screen. How do we tell the computer to do that?  This kinds of things we will learn in these tutorials.

So for this first one I will tell you that we are going to learn a language called LUA. And for now that’s all you need to know about it.

To get ready for the next tutorial I want you to grab a notebook (a paper one), a pencil and eraser, that’s all. We need to write down some information before we proceed with the actual programming. Later you’ll have a summary of the commands that you can use.

See you next week!


Friday, 27 July 2012

What is a Spritesheet? (not a drink)



SpriteSheets video

Thanks Andreas Loew for letting me share this content.

Thursday, 26 July 2012

P7 - How to make an iPad eBook with CoronaSDK




So let’s get to it.

Wednesday, 25 July 2012

Nook store nightmares...

Ok, that's it for now.