Jump to content
MakeWebGames

BlackScorp

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by BlackScorp

  1. And once you learned the frameworks and shops and stuffs, then start to learn architectures, Data Context Interaction or Clean Code. The Goal of them is to Create undependant scripts. So once you learned it, it doesnt really matter anymore if you want to implement a feature into Magento or Wordpress or anything, you can even pick your plugins from Wordpress and reuse them in Magento. Some links;) http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html
  2. Hello guys, i would like to present my project OpenTribes. OpenTribes is a Strategy Browserbased games which is similar to tribalwars. My Personal goal on this Project is to learn and practise the Clean Code Architecture http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html Technical Details: I test the code base with Behat and Mink. So i describe a feature i want to implement in a Domain Specific Language https://github.com/Opentribes/Core/blob/develop/features/Account/create.feature after, behat generates a code skeleton which i can fill and test if my code is running without errors. Then i reuse this feature with another Context and Mink. Mink allows you to run a headless browser instance and you test your front end https://github.com/Opentribes/Core/blob/develop/features/bootstrap/silex/UserHelper.php#L40 you have methods like fillField, pressButton visit($url) and so on and you can assert if a div with class xyz is existing inside HTML Document As delivery mechnism I'am using Silex and Symfony Components Also you can create Modules which can overwrite just everything(every controller,template or other class) thx to the Dependency Injection Container. The Modules can be installed later over composer. As Template Engine, i use Mustache Currently not really much works ingame, just login/registration/activate account. And here is the Code https://github.com/Opentribes/Core Everything is under MIT License, so later you schould be able to reuse the code and even remove the copyrights from the site If you have any questions just ask:D if you found any issues on code, post them on github issue tracker. Best Regards and sorry for my bad english grammar
  3. check your code for $id = mysql_real_escape_string($_GET['id']); mysql_query(somquery which uses the ID) cause this can be used for SQL Injections, to prevent this you have to cast the id to integer like $id = (int) $_GET['id']
  4. well iam currentl developing a game, sadly because of the publisher iam not allowed to show a link :(
  5. well yeah, the resolutions is pretty bad, but this is just because of pixel art, it seems it is not that easy to create high res pixel arts. if you resize your browser to like 400px width and 320px height, it looks much better:D well just to mention, this game was made in one month, coding and creating graphics. Clint Bellanger is basicly a programmer, and i must say, the graphics looks pretty good for a programmer. another project he is making is http://flarerpg.org/ the code is made in C++ but for webgames the graphic source is more interesting. since all graphics ingame you can reuse it. they are on github as .blend file, including a python script to export blender animations into spritesheets, which are used in that C++ code.
  6. Hi guys, could be maybe interesting for someone here http://heroinedusk.com/demo/ looks really sweet, what do you think? btw the game is Open Source
  7. even adobe itselfs force to develop with HTML5, since they develop some free tools to make good HTML5 animations for example
  8. i gues you didnt saw what is able to do with JS? just an example: http://threejs.org/ or more examples: http://news.turbulenz.com/post/49430669886/turbulenz-engine-goes-open-source also, i miss adobe Shockwave on that list;) to see what can shockwave do you can look here: http://www.maidmarian.com/sherwoodlanding.htm and you can do fancy 3D stuffs with CSS Transforms http://keithclark.co.uk/labs/css3-fps/ ah and Unreal Engine as JavaScript btw http://www.unrealengine.com/html5/
  9. http://demo.modulargaming.com/guide-api doenst work, because Shadowhand/Email doesnt have the init.php https://github.com/shadowhand/email/issues?state=open see my issue
  10. well about MMORPG you can take a look at following games http://browserquest.mozilla.org/ here the Code https://github.com/mozilla/BrowserQuest it is based on NodeJS(Serverside JavaScript) another one is based on PHP http://sourceforge.net/projects/worldofkallen/ if you need fancy graphics to replace the original once take a look here http://opengameart.org/ Best regards EDIT: OOPS thought youre looking for an MMOPRG but youre just looking for an addon.. sorry then for polating the thread
  11. +1 ...........
  12. sorry misunderstood you, thought because youre administrator of this forum, so youre owner of this mccodes(which has many topics here in forums).. well i ok then. anyways using MVC and another Designer Pattern would be a good way, but youre also able to make many things wrong in MVC. Currently i had more disadvantages on pure php scripts than in MVC applications. personally i used it even for a one page portfolio because one day an application need more requirements. a bit overhead is ok as long as you have a reusable and maintable code
  13. this was just an example, i thought a_bertrand is speaking about rewriting mccodes or were my thoughts wrong? the links i posted are no alternatives, you can see them as "extensions" for MVC, since MVC does not cover all needed things in webapplication because so many technologies are combined. you can use HTML output as view, you can also create json output and pas it to a flash/silverlight/pure JS application. you can handle requests by PHP or you can handle requests by Apache and .htaccess or you can even mix it. You can use Models as mysql DB, you can also create a Model which is using an oAuth API to store or get data from another server. you can even save data on local storages and use JavaScript as Model. MVC cannot describe all posibilities nor you can see it as standard. You could describe it as "Best Practice"
  14. as i told. if you would start from the Scratch, then just seperated the Buisness logic. So programmer which dont use MVC can still call in their login.php following code require_once 'path/to/mccodes/init.php'; class Mysql_Account_Repository extends Account_Repository{ public function create(array $data){ //insert into code } } $repository = new Mysql_Account_Repository(); $login = new Account_Login($repository); if($login->execute()){ //redirect }else{ //show error }   if you implemented PSR-0 autoloading, so it is even easier to use your Buisness Logic in Frameworks like Zend/Symfony/Lavarel/Kohana etc. dont think about MVC or Not, think about to create kind of API which can be implemented in simple php files or complex MVC Frameworks. just my 2cent EDIT: @k1ngscorp1o Well a usual MVC Application in PHP has more than Model,View,Controller. There is also a Request, Response and Route classes. a Controller does not display stuffs it pass data from Model to view or from Request to Model and controller pass the view to Response classes, so the response do the output, the controller just trigger it. and if MVC would be a "fit always" solution, why there exesists other Pattern for Webapplications like MVVM (http://en.wikipedia.org/wiki/Model_View_ViewModel) MVP (http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter) HMVC (http://en.wikipedia.org/wiki/Hierarchical_model%E2%80%93view%E2%80%93controller)
  15. Well, many ppls speaking about MVC but MVC does not work in PHP since PHP Code has no state. In Most Cases Web Applications are following Front Controller Pattern seperated into Model Views and Controllers. In my Opinion , if you wish to implement unit tests and other tests. Try to use "Clean Code". http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html With Clean Code you just Create your custom classes outside of any Frameworks. The MVC Frameworks are used as "Detail" which call your classes and display some HTML Code depends on Request.(Delivery Mechanism) Here a video of Uncle Bob The key of Clean Code is produce an application independant of Framework,Database,Webserver so anyone would just pick your engine and call your classes/methods in Zend Framework for example, others who prefere Sympfony, would just use em. Advantage is, you could just use your data structure later as an API for example. The Hard part would be the Plugins. If you use Clean Code your plugins could have some of Buisness Logic but they also need a delivery mechanism to use the Buisness Logic. so a plugin may needed to be created with other Frameworks as well. Personally iam using Clean Code with Kohana Framework as Delivery Mechanism and not just MVC but HMVC + MVVM(MVP), which basicly means that Views are Plain Old PHP Objects which are rendered by a Template engine. I User http://behat.org/ for describe Features and create unit tests. Basicly just simple classes filled with sample Data, once feature is complete and tests are passed i implement it in Controllers. http://zombor.github.com/ a good Tutorial for it. Hope it helps to understand that MVC doesnt matter
  16. well removed singleton
  17. tbh. just because i didnt mentioned it, it doesnt mean that its not working. i added now start rows and cols inputfields to create a map from -y/x in the demo to demonstrate it   $grid = array( '-10'=>arrray('-10'=>1,'-9'=>2) );   something like this is possible as grid
  18. if you would not trolling, then you would understand that this code snipped is ment to be implemented in Controller/Action of your MVC Application.   the $grid in this case is ment to be a result set from the database or other places where you store your map. you need to know the whole map to calculate the shortest path between 2 points this are coordiantes.. a 2d map is nothing else like a 2d array
  19. well a forum troll it seems. Interessting how could you sure about it? take a look at this example http://swiftmailer.org/docs/sending.html doesnt look Object Oriented for you? anyways iam not only using classes but in this code you dont need any design pattern just pure Classes for Typehints + calculations and a Factory Pattern to load the algorithm. Please stop trolling
  20. you know this is just a code snippet how to use the classes, the code is fully object oriented including typhints for parameters
  21. Hello All, iam currently selling my A* search algorithm implementation. Features: OOP PSR-0 Standard Classnames with Autoloading Including Manhattan Heursitics and Diagonal Heuristics (http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html) Custom Blocked Types Binaryheap Example Implementation:   rquire_once 'path/to/astar.php'; $diagonal = true; //Just for readability you can add any number in array class Type{ const WALL = 1; const FLOOR = 0; const CHAIR = 2; const TABLE = 3; const CUBE = 6; } //y/x grid $grid = array( array(Type::WALL,Type::WALL,Type::WALL,1,1,1,1,1,1), array(1,0,0,2,0,0,0,0,1), array(1,0,0,6,0,0,3,0,1), array(1,1,1,1,1,1,1,1,1), ); $graph = new Graph($grid); //convert Array to Node Objects $start_node = $graph->node(1,1); //pick node x =1,y=1 as start point $end_node = $graph->node(7,3); //pick node x=7,y=3 as end point if($start_node && $end_node){ $astar = new Astar($graph); //accept only instance of Graph $astar->blocked(array(Type::WALL,Type::CHAIR,Type::TABLE)); $astar->diagonal($diagonal); $astar->heuristic(Astar::DIAGONAL); //setup heuristics Astar::DIAGONAL || Astar::MANHATTAN $result = $astar->search($start_node, $end_node); } if(count($result) > 0){ foreach ($result as $node) { echo $node->x; echo $node->y; echo $node->type; } }else{ echo "Path not found"; } }   here is a demo to test around http://astar.blackscorp.de/ if anone is interested just PM me Best regards BlackScorp
  22. thx for the reply, i know why i dont like IE/Opera/Safari ...
  23. Hello all, i gues i fixed the issue with loading and sounds now, tested sofar on Ubuntu + Firefox,Chrome and opera, maybe someone here has an Safari or IE and can test it? Note that HTML5 Audio is supported with IE9+
  24. EDIT: i seems that i fixed the loading bug, but the IE does not play the sounds..
  25. damn loader, damn sounds, damn IE :D working on it, if it is fixed i will post the updates :D
×
×
  • Create New...