Community

Good Programming Technique 101

Posted Dec 6, '10 at 10:47am

Stranger087

Stranger087

2 posts

Iron - Serf

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

Iron - Serf

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

 

Posted Dec 10, '10 at 7:59pm

Darkroot

Darkroot

2,438 posts

Wood - Prince

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

 

Posted Dec 10, '10 at 8:01pm

Matrix159

Matrix159

246 posts

Gold - Knight

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

 

Posted Dec 18, '10 at 12:42pm

domecraft

domecraft

149 posts

Gold - Squire

thx for the tips!!!!

 

Posted Jan 15, '11 at 5:58pm

crazyape

crazyape

271 posts

Iron - Knight

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

Wood - Squire

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

 

Posted Mar 13, '11 at 3:43pm

Ggbuddy

Ggbuddy

2 posts

Gold - Serf

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

220 posts

Wood - Squire

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

107 posts

Gold - Squire

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!