Jump to content
  • Advertisement

TheNess

Member
  • Content Count

    36
  • Joined

  • Last visited

Everything posted by TheNess

  1. So this one needs some background...   Basically I needed a way to execute untrusted (user-generated) code on Node.js / browsers, and I ended up writing a Python-like language on top of JavaScript, designed to execute unsafe code in a safe way (http://adderscript.com/).   The game I'm posting here is a demonstration game for the language; its a web game (no canvas nor WebGL, only HTML elements :P) where you need to write an AI to defeat the house AI. You can play it here:   http://adderscript.com/examples/BotWars/BotWars.html   Feedback will be appreciated Cheers!  :D    
  2.   Thanks! :)   To access enemy states you can use the 'Enemy' module, it has the same API as 'Self' (more details in API, click on the "Show API" button. you can also see it used by the enemy code in "Show enemy code").   As for a way to store global vars, by default all vars are global and remain between executions. you can do something like this:   # for first-time execution - create the var if not exist("global_var"): global_var = 0 # every round the var will increase by 1 and we'll print it global_var += 1 print(global_var) The code above will print incrementing numbers every round.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!