Set Interval only run once

All things HTML5 or text based engines, or really any web based engines.
Post Reply
dsteve
Posts: 16
Joined: Mon Oct 07, 2013 6:25 pm

Set Interval only run once

Post by dsteve »

Dear All who are using isogenic engine,

Hi, I am creating a game with a setInterval,
Apparently, the set interval only run once,
whether I put set interval in ClientObject.js

Code: Select all

			
this.interval_id=setInterval(this.work(this.produce_interval),1000);
		},
		
		work: function(produce_interval){
			console.log("berhasil");
		}
or in
client.js,

Code: Select all

									case BUILDING_TYPE.STADIUM:
										tempItem = ige.client.createTemporaryItem('Stadium') // SkyScraper, Electricals etc
											.opacity(0.7);
										tempItem.interval_id=setInterval(tempItem.work(tempItem.produce_interval),1000);
									break; 
It still only run once by the engine,
Am I missing something?


Best Regards,
Steven
User avatar
coolbloke1324
Posts: 181
Joined: Mon Jan 23, 2012 5:20 pm

Re: Set Interval only run once

Post by coolbloke1324 »

Set interval is not "run by the engine", it's a javascript native method. Have you checked your console log for errors?

Dont forget we have moved to a new forum http://www.isogenicengine.com/forum
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
dsteve
Posts: 16
Joined: Mon Oct 07, 2013 6:25 pm

Re: Set Interval only run once

Post by dsteve »

Dear Rob,

Thank you very much for answering my question, I have moved the thread to your new forum(it looks awesome),
But there is no error,

Best regards,
Steven
Post Reply

Return to “HTML5/Web Engines”