Nimrod09
449 posts
|
It all started when I saw the Stride contest…a good idle will do, (I think…) Can anyone help?
|
|
|
Osiris602
278 posts
|
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…
|
|
|
Nimrod09
449 posts
|
Thanks, i’ll try that. (Hey its worth a try isnt it???)
|
|
|
Osiris602
278 posts
|
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
|
|
|
Nimrod09
449 posts
|
Hmmmm….its saying I have an error… ‘(’ expected. What does that mean and how do I fix it?
|
|
|
Nimrod09
449 posts
|
Where? It says: ‘(’ expected function onEnterFrame {
|
|
|
Osiris602
278 posts
|
it means you have to put the parameters……. () ALWAYS REPEAT ALWAYS ALWAYS ALWAYS FOLLOWS FUNCTIONS EVEN IF ITS EMPTY… always
|
|
|
Osiris602
278 posts
|
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 =/
|
|
|
Nimrod09
449 posts
|
So the text box has to be dynamic?
|
|
|
Osiris602
278 posts
|
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
|
|
|
Nimrod09
449 posts
|
Ok. But NOW the text box is saying: NaN, what should I do…
|
|
|
Osiris602
278 posts
|
|
|
|
Nimrod09
449 posts
|
|
|
|
faiuwle
116 posts
|
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.”
|
|
|
Draco18s
5875 posts
|
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.
|
|
|
Cloud_9ine
2434 posts
|
Oh my god, the entire beginning I thought was jsut one person. Also, yea Idle wont win much.
|
|
|
BillysGames
235 posts
|
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
|
|
|
Osiris602
278 posts
|
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
|
|
|
shittasticf
3 posts
|
Actually, if you want to split hairs, it should really be
var score:Number = 0;
there’s no int in AS2.
|
|
|
Nimrod09
449 posts
|
Jeez I dont care if it doesnt win, I just need a tutorial!
|
|
|
SuperMarioJump
303 posts
|
The complete source code is in the fourth post.
|
|
|
Highscore
82 posts
|
What program are you guys using to make this ‘idle’ game?
|
|
|
Tukkun
5337 posts
|
As always:
score = 0;
onEnterFrame = function () {
score += 1;
}
Also, Flash, obviously ;)
|
|
|
tadster
294 posts
|
idle… so an ‘idle’ game does nothing more than show a score?
And they allow that kind of game here?
What’s the purpose?
|
|
|
GameBuilder15
7849 posts
|
Originally posted by tadster:
idle… so an ‘idle’ game does nothing more than show a score?
And they allow that kind of game here?
What’s the purpose?
to sit around and get a high score
|