DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Code Combat!  (Read 16,968 times)

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,027
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Linux User
Code Combat!
« on: December 06, 2014, 04:49 AM »
I considered posting this in Developer's Corner, but I think it should live here...

Quote
CodeCombat: Learn to Code by Playing a Game
Learn programming with a multiplayer live coding strategy game. You're a wizard, and your spells are JavaScript.


Well, Javascript & Python, with experimental use of Lua, Clojure, and a few others.

I played through a few levels, at first it was a bit boring, as you are limited to directions - 'self.moveRight()', that kind of thing.  But like any good adventure game, you pick up money and items along the way and are shown new programming tricks to access new your new abilities and items to get through the different mazes.  Very good for introducing programming to pre-to-mid-teens who haven't already picked up some javascript...


from TechRepublic - 10 Toys and Games that Teach Coding
All children left unattended will be given a mocha and a puppy.
« Last Edit: December 06, 2014, 10:07 AM by Edvard »

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Code Combat!
« Reply #1 on: December 06, 2014, 06:03 AM »
That's a really damn cool game!!!  :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup: :Thmbsup:
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Code Combat!
« Reply #2 on: December 06, 2014, 01:21 PM »
Here's an SS of my character a few problems ago.

Screenshot - 2014_12_06 , 11_30_50 PM.png

Here's the first solution:

Code: (javascript)
// Move to the gem.
// Don't touch the walls!
// Type your code below.

this.moveRight();
this.moveDown();
this.moveRight();

So, very simple to get you used to the game. It adds methods/functions (I hate how JS uses "function" for everything when they would be better off distinguishing.)

this.moveXY(x, y); comes a bit later.

Here's an example of a problem solution:

Code: (javascript)
var enemy = this.findNearestEnemy();
var count = 1;
loop {
	enemy = this.findNearestEnemy();
	if (enemy)
	{
		if (this.isReady("cleave"))
		{
			this.cleave(enemy);
		} else {
			this.shield();
		}
	}
}


Here's a problem:

Code: (javascript)
// Collect all the coins in each meadow.
// Use flags to move between meadows.
// Press Submit when you are ready to place flags.

loop {
    var flag = this.findFlag();
    if (flag) {
        // Pick up the flag.

    } else {
        // Automatically move to the nearest item you see.
        var item = this.findNearestItem();
        if (item) {
            var position = item.pos;
            var x = position.x;
            var y = position.y;
            this.moveXY(x, y);
        }
    }
}

And the solution:

Code: (javascript)
// Collect all the coins in each meadow.
// Use flags to move between meadows.
// Press Submit when you are ready to place flags.

loop {
    var flag = this.findFlag();
    if (flag) {
        // Pick up the flag.
        this.pickUpFlag(flag);
    } else {
        // Automatically move to the nearest item you see.
        var item = this.findNearestItem();
        if (item) {
            var position = item.pos;
            var x = position.x;
            var y = position.y;
            this.moveXY(x, y);
        }
    }
}

Which shows how they gently ease you into new methods/functions.

They have a business model as well.

Screenshot - 2014_12_07 , 12_03_45 AM.png

It's also open source.

Like... dammit... this is a friggin' cool game. This is the kind of game parents should PAY their kids to play! It's. That. Damn. Good.

Cudos to the developers. They've created a truly useful, brilliant game.

Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

bit

  • Supporting Member
  • Joined in 2013
  • **
  • Posts: 686
Re: Code Combat!
« Reply #3 on: December 07, 2014, 12:31 AM »
^Yes, this is totally awesome.  :Thmbsup:
« Last Edit: March 04, 2015, 04:29 PM by bit »

rxantos

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 116
Re: Code Combat!
« Reply #4 on: January 30, 2015, 05:08 AM »
Interesting and addictive game. Thanks for sharing the link.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
Re: Code Combat!
« Reply #5 on: January 30, 2015, 05:18 AM »
Another programming game I stumbled on seems much more focused on hard core or at least more efficiency-minded coders, but is very cool:
http://play.elevatorsaga.com/

Renegade

  • Tell me something you don't know...
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,291
    • Participated in NANY Challenge Three Times
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Code Combat!
« Reply #6 on: January 31, 2015, 02:01 AM »
Another programming game I stumbled on seems much more focused on hard core or at least more efficiency-minded coders, but is very cool:
http://play.elevatorsaga.com/

Interesting. And yes - very much "hard core". There's no tutorial to get you up to speed, but there is a wiki, so you can study the API, but you're very much just left on your own.

I've been traveling the last week, and had lots of elevators. Funnily enough, I was thinking a few times about elevator algorithms. Some are really good, and others, not so much.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Original address: https://www.donationcoder.com/forum/index.php?topic=39758.0