Looking to learn to code: where do I sign up?

A spot for all things TestTube
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Looking to learn to code: where do I sign up?

Post by robly18 »

So for a long time now I've always wanted to code stuff. I looked at an amazing game and thought "I wanna make something like this". I looked at something that made me think and thought "I want to make a simulation of this". I looked at code and thought "wtf is this I don't even".

Then I looked at the works of Andy and ARP and I thought "maybe these guys can help me learn?"
So, I come to you, test tube games. If I want to learn to code, what would be a good coding language, how and where can I learn it, and how do I make stuff in it?
Convincing people that 0.9999... = 1 since 2012
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Looking to learn to code: where do I sign up?

Post by A Random Player »

Well, you know about the basics of programs and algorithms (like loops and conditionals ("if blah, do blah, otherwise, do blah")), right? So then you just need a good language.
To make simple programs, I recommend Python. Some people say C, C++, or Java, but I think those are a bit complicated (If you just want to say "Hi", you shouldn't need a 6 line program to do so!) It's free to download, but I use codepad to run stuff (the only problem being no input). Python's tutorial is very straightforward, and you can write fairly complex scripts after learning for half an hour. A quick google search for most questions gives the answer almost immediately too.

Though I actually didn't start with Python. If you have an TI calculator (83-84; any less is not very good, any more is too complicated), the (computer) manual that comes with it is fairly good at explaining the syntax of its built in language TI-Basic. It doesn't really explain things for computer languages ("Wut is stdio.h??? Why do I need it??? Cant I just use print 1+3???"), but is good at teaching concepts like loops, conditionals, and gotos. And you can impress your friends by making cool games (seriously, even a simple guess the number game) :P I think some trial and error is needed for more complex things though.

Andy uses Flash/Actionscript, which is basically what every game uses now; Python is mainly for scripting. From Kongregate (Not congregate, spellcheck!) to coolmath-games to TestTubeGames. He mentions the Shootorial series, which seems to be good for AS. The problem with the series is it's for AS 2.0, and the current version is 3.0. (Cue disappointment when I realized that the tutorial didn't work on my copy of flash :() With some searching you might find a good tutorial for 3.0, but I didn't find one.

As Andy mentioned in his blog, HTML5 and Unity are some alternatives to Flash. I have no experience with either, so I'm not sure if they're good.

For programming exercises, Project Euler is a good place to start. It gets you thinking about how to solve problems with programs. (But they do get complicated!)

In short, I recommend Python, and once you're experience with programming, try something else like C or Java. All computer people need to know at least 2 languages ;)
Last edited by A Random Player on Tue Aug 06, 2013 2:26 pm, edited 1 time in total.
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Looking to learn to code: where do I sign up?

Post by testtubegames »

First off, I pretty much agree with everything ARP said. I'll add in my 2 cents, but as a disclaimer -- I didn't come into programming in the traditional way. Sure, I'd done a bit of Mathematica back in college for various physics projects, but nothing more than that. I really got started programming in ActionScript 2. (And in the meantime, I've moved on to a whole bunch of other languages... and I do my flash games in AS3 now, which is slightly different than AS2.)

I think the language you start in has a lot to do with what your goals are. If you want to learn the rudiments of programming -- I think ARP's suggestion of Python is a good way to go. It's easy to start using, and you can do tons with it.

That wasn't where I started, since my goal was different. I wanted to make games (or at least 'interactive' stuff). So Flash (AS2 or AS3) was an obvious place to start. It takes a fair investment of time to get started. You have to download the proper software -- there's the goto expensive version people often get, but there are ways of compiling flash for free -- which I use. Whatever method you use, once you set it up, you'll be able to make some nice interactive games & sims. There is, in fact, a Shootorial for AS3 -- my first foray was using the Shootorial for AS2, so I imagine that'd be a nice place to start. I'm happy to discuss all the details (more tutorials I'd suggest, etc), but I'll leave that there for now.

If you want to make games with less initial investment (nothing to download, say), HTML5 might be a good place to start. It's in its infancy in many ways, but you can get started right away. The language you'd code your game in is Javascript, which is fairly simple and very easy to use. Now, it does have more limits than Flash at the moment -- I wouldn't make a full-fledged game in it, myself. But for simple things (a box moving on the screen, pulled by a gravity well... or trying your hand at a basic evolution game), it would work nicely.

So if learning how to code is your goal -- I'd probably go with ARP's suggestions. If you're interested in making visual and interactive things, then I'd lean towards Flash (ActionScript) or HTML5.
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Looking to learn to code: where do I sign up?

Post by robly18 »

Thank you all for your responses! I'll give a try at actionscript and python. I'll let you know if I come up with anything even remotely worth mentioning!
Convincing people that 0.9999... = 1 since 2012
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Looking to learn to code: where do I sign up?

Post by robly18 »

Okay so I've been trying to use actionscript. I have installed it correctly, and have tried running some of the files that come with the first tutorial you gave me. However, I tried the shootorial, and fell face first on the first part. Seeing as I'm using the SDK, how am I supposed to create the fla or whatever it is?
Convincing people that 0.9999... = 1 since 2012
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Looking to learn to code: where do I sign up?

Post by testtubegames »

I'm glad to hear the stuff from senocular (about flex and mxml and such) worked out for you. I'm a big fan of it, since then you can do everything in code. You were able to do his tutorials about drawing squares and such?

The shootorial is directed at the standard pay-version of flash (not uncommon in tutorials). However, it just takes a few modifications to make it work. Really, the only tough spots is how the initial setup differs. All the interesting stuff (how mouse clicks work and such, drawing and adding thing to the screen, doing math functions) is the same.

I was surprised to not find too many tutorials for how to compensate for not using Adobe's Creative Suites (paid-flash version). So I got you started myself... I attached the files here.

You'll skip quite a few steps of the shootorial -- especially in the first ones. All the .fla stuff -- you don't have to care about. Importing classes via a drop-down menu? No way! The way images get added is different, too. But the core of the actual code that goes into the class files, that'll be the same.

If you download the files I've attached and open the html file, you should have a screen with a ship (shocktopus) on it. In the src folder, you'll find the code, split into Game.as and Ship.as (just as they do in their tutorial). To make a new class, all you need to do is make a new .as file. Simple as that! Compiling works the same way as in the senocular tutorials -- I added the compile code I use to the Game.as file, so you can just copy-paste that.

I made a few little changes to the tutorial code -- and tried to label most of them. I got you to about page 9 of the first Shootorial, so if you pick up there, things should make a bit of sense. Here's hoping it's still a good tutorial for you.
Attachments
shootorialTTG.zip
Modified start to the shootorial
(22.39 KiB) Downloaded 474 times
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Looking to learn to code: where do I sign up?

Post by robly18 »

Thank you so much Andy! Who knows, maybe someday I'll be good enough to make a game you'd put up in your page? :lol:
I'm just dreaming though. Thanks for the help. Immensely. If I need anything else, I'll make sure to ask... I'll try not to be a pain either though . :D

PS:Upon trying to open the program with regular notepad (insert obligatory insult to it here) I realized the spacing was all weird. Then I installed notepad++ (I had no reason to do so up until now) because I had guessed a smart person like you would be using it as opposed to microsoft's. So now I have it installed, and it makes coding much less of a chore. Thank you. For everything.
Convincing people that 0.9999... = 1 since 2012
A Random Player
Posts: 523
Joined: Mon Jun 03, 2013 4:54 pm

Re: Looking to learn to code: where do I sign up?

Post by A Random Player »

Thank you Andy for giving me the link to the AS3.0 Shootorial - I've got the first one working already :D
(If it doesn't work, try checking the case of some things.)
$1 = 100¢ = (10¢)^2 = ($0.10)^2 = $0.01 = 1¢ [1]
Always check your units or you will have no money!
User avatar
robly18
Posts: 413
Joined: Tue Jun 04, 2013 2:03 pm

Re: Looking to learn to code: where do I sign up?

Post by robly18 »

Alright, so.
I've recently put some work into actually figuring out python, and I was surprised. All this time, I thought it was confusing with all the string stuff and whatnot (I was doing the google tutorial), but it turned out to be pretty similar to lua!
So far I've managed to make a simple program that does simple operations you input, like 1+1 or 9*2. I'll leave a download link for those interested:
http://www.mediafire.com/download/tj7b5 ... a/oper.rar

(To run: run test.exe. No need to unzip or anything)

Text version, in case you want to see the code or have a phobia of exe's:

http://www.mediafire.com/?65armgjkbyzjjc0

UPDATE: I've just finished every problem in Project Euler I'd previously solved, which was 1,2,3, 5 and 6, while learning that brute force is a horrible method, and a bunch of new syntax!
Convincing people that 0.9999... = 1 since 2012
User avatar
testtubegames
Site Admin
Posts: 1148
Joined: Mon Nov 19, 2012 7:54 pm

Re: Looking to learn to code: where do I sign up?

Post by testtubegames »

...Nooooorris!

That's awesome, robly. Worked very slickly, nice job!

I *did* get told to complain to you once or twice, but that's just 'cause I wanted to know know "hot dog + potato". That will remain one of life's great mysteries, I suppose.
Post Reply