Forums

ForumsProgramming Forum

Good Programming Technique 101

Posted Dec 6, '10 at 10:47am

Stranger087

Stranger087

2 posts

enterFrame is not good...

everybody should use setInterval(function name, 1000/fps,params)

like this:

i=0;
del = 1000/10;
inid = setInterval(this.game, del);
function game() {
i++;
trace(i);
}
this.onMouseDown = function () {
clearInterval(inid);  /*because you can set a lot of intervals for a single function*/
del/=2;
inid = setInterval(this.game, del); // gamespeed doubled
}
now u can make dynamic gamespeed, like in gemcraft xD

 

Posted Dec 6, '10 at 10:51am

Stranger087

Stranger087

2 posts

oh, and updateAfterEvent() at the end of main function... =/

 

Posted Dec 10, '10 at 7:59pm

Darkroot

Darkroot

2,549 posts

Yeah but most people only need an enterFrame for their purposes.

 

Posted Dec 10, '10 at 8:01pm

Matrix159

Matrix159

256 posts

If only I could understand all of that code.... XD

 

Posted Dec 18, '10 at 12:42pm

domecraft

domecraft

149 posts

thx for the tips!!!!

 

Posted Jan 15, '11 at 5:58pm

crazyape

crazyape

501 posts

Begginers should start on basic html coding XD just use notepad....I can just barely do that...then again...it takes me half an hour to FIND notepad....

 

Posted Jan 22, '11 at 6:01am

vikder

vikder

9 posts

its quite complex...:S:S:S

 

Posted Mar 13, '11 at 3:43pm

Ggbuddy

Ggbuddy

2 posts

I was wondering how I should get started. I am new to programming. However, I have basic knowledge in Java, both Procedural and Object Oriented. So, it would be helpful if you could tell me where I should get started and what I should learn.

 

Posted Mar 14, '11 at 6:51am

ExplosionsHurt

ExplosionsHurt

247 posts

I...actually...get it.

I'll see if I can get Flash, but... $699 is a lot of dough.

 

Posted Mar 18, '11 at 9:29am

Xinito

Xinito

108 posts

I want to make Games so bad...But i'm not good in Coding ect.. :S

 
Reply to Good Programming Technique 101

You must be logged in to post a reply!