Create an Account
username: password:
 
  MemeStreams Logo

MemeStreams Discussion

search


This page contains all of the posts and discussion on MemeStreams referencing the following web page: Old school Computer games using <CANVAS>. You can find discussions on MemeStreams as you surf the web, even if you aren't a MemeStreams member, using the Threads Bookmarklet.

Old school Computer games using <CANVAS>
by Acidus at 9:29 pm EDT, Oct 8, 2009

This article talks about a guy who ported some older Sierra computer games to the browser using the CANVAS tag. Thats not whats cool. What is cool is this:

I was able to convert the logic to javascript, but there was one big problem: Sierra’s code used GOTO statements, and those could jump anywhere in the code, even inside a nested “if”-statement. It seemed unsolvable in javascript.

I sat down together with Sjoerd Visscher, one of my collegues at Q42, and we came up with a solution. Using a decompilation approach to get rid of nested “if”-statements and putting the whole shebang inside a huge switch/case statement, we could mimic line numbers and GOTO’s while maintaining performance. World domination was within reach :-D

He is emulating line numbers using a giant SWITCH Case where each "case" statement is a line number! Neat hack!


 
 
Powered By Industrial Memetics