How do you make an idle game?

Subscribe to How do you make an idle game? 21 posts, 8 voices

Sign in to reply


 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

It all started when I saw the Stride contest…a good idle will do, (I think…) Can anyone help?

 
avatar for Osiris602 Osiris602 81 posts
Flag Post

well you could always go with the
function onEnterFrame() {
score += 1
_root.scoreText.text = score
}

then add a text box to display your score and yep… thats pretty much it…

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

Thanks, i’ll try that. (Hey its worth a try isnt it???)

 
avatar for Osiris602 Osiris602 81 posts
Flag Post
Originally posted by shittasticf:

package{

import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.utils.Timer;

public class Main extends Sprite{

private var display:TextField;
private var t:Timer;

public function Main(){

display = new TextField();
addChild(display);

t = new Timer(1000);
t.addEventListener(Event.TIMER, update);
t.start();

}

public function update(e:Event):void{

display.text = String(t.currentCount);

}

}

}

eh, he did it the fancy shmancy way

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

Hmmmm….its saying I have an error… ‘(’ expected. What does that mean and how do I fix it?

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

Where? It says: ‘(’ expected function onEnterFrame {

 
avatar for Osiris602 Osiris602 81 posts
Flag Post

it means you have to put the parameters……. () ALWAYS REPEAT ALWAYS ALWAYS ALWAYS FOLLOWS FUNCTIONS EVEN IF ITS EMPTY… always

 
avatar for Osiris602 Osiris602 81 posts
Flag Post

yeah i know i thought it would be obvious and he’d put them in so i didn’t even bother to go back and change it but now i did, so instead of copying and pasting it, he could learn about what hes doing first =/

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

So the text box has to be dynamic?

 
avatar for Osiris602 Osiris602 81 posts
Flag Post

yeah it must be dynamic just make a textbox, give it the instance name scoreText and put in the code i told you but make sure you know what it means

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

Ok. But NOW the text box is saying: NaN, what should I do…

 
avatar for Osiris602 Osiris602 81 posts
Flag Post

name the variable score

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

Nope, still says it.

 
avatar for faiuwle faiuwle 107 posts
Flag Post

Actually, if you want to split hairs, it should really be

var score:int = 0;

but it was obvious (to anyone who knows what they’re doing) what was meant by that code snippet. It’s more like “know what you’re doing before expecting people to write your game for you.”

 
avatar for Draco18s Draco18s 2343 posts
Flag Post

Just FYI, its not going to win. It won’t even place, or be anywhere near the runners up slots (11th through 20th place). A good endurance game has a way to lose.

 
avatar for Cloud_9ine Cloud_9ine 2244 posts
Flag Post

Oh my god, the entire beginning I thought was jsut one person. Also, yea Idle wont win much.

 
avatar for BillysGames BillysGames 25 posts
Flag Post

I have source code available on my, er, ‘game’, “Simple Idle”

It’s flex-based, so you can continue building an interface easily, and make it into something more substantial (well, you know, as far as idle games go)

http://www.kongregate.com/games/BillysGames/simple-idle
Just right click and view source, and it will pop up the text of a .mxml file. This can be compiled with the free Flex SDK

 
avatar for Osiris602 Osiris602 81 posts
Flag Post
Originally posted by faiuwle:

Actually, if you want to split hairs, it should really be

var score:int = 0;

but it was obvious (to anyone who knows what they’re doing) what was meant by that code snippet. It’s more like “know what you’re doing before expecting people to write your game for you.”

lol love it

 
avatar for shittasticf shittasticf 3 posts
Flag Post

Actually, if you want to split hairs, it should really be

var score:Number = 0;

there’s no int in AS2.

 
avatar for Nimrod09 Nimrod09 46 posts
Flag Post

Jeez I dont care if it doesnt win, I just need a tutorial!

 
avatar for SuperMarioJump SuperMarioJump 223 posts
Flag Post

The complete source code is in the fourth post.

Sign in to reply


Click Here