Jump to content

Search the Community

Showing results for tags 'fp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. hi, i'm happy to play now with short code and modularize them together. What saves time and readability ! But in this case i don't see what it's possible to do with the function foreach. Is it possible to use foreach like this config with a trick in the hide_weapon_internal ? //normal function who works if(dalle_moving[0]){ for (var j = 0; j < dalle_moving.length; j++){ dalle_moving[j].hide() } } //////////////////////////////////////////////////////////////////////////////////// //NOW WITH FUNCTIONAL PROGRAMATION function is_exist(obj){ if(typeof obj != "undefined"){ return true; }else{ return false; } } function foreach(table,action){ for(var i=0;i<table.length;i++){ action(table[i]); } } ////////////////////////////////////////// var hide_enemy=function(obj){ is_exist(obj[0]) && foreach(obj,obj.hide) } hide_enemy(dalle_moving) ////////////////////////////////////////// //obj.hide don't works because i must say action(obj[i].hide()) //is there a trick to do that with the function foreach as she is ? i have the feeling that 's possible ....no?
×
×
  • Create New...