Jump to content
MakeWebGames

BlackScorp

Members
  • Posts

    61
  • Joined

  • Last visited

Everything posted by BlackScorp

  1. but if you want do this, you have to know each special stuffs for each browser and version, even the jQuery developer dont know all special cases since they fixed the bugs over the years. vanilla JS is nice, but will bring you a lot of trouble which ends up with using jQuery and drop your current code away, which will be wasted time at the end
  2. just want to say that keyCode is not supported by all browsers, in some browsers there are no keyCode at all https://github.com/BlackScorp/tiled2crafty/blob/gh-pages/kinetic/js/libs/Keyboard.js#L116-L119 here is an crossbrowser version. you can use it like this https://github.com/BlackScorp/tiled2crafty/blob/gh-pages/kinetic/js/game/game.js#L39-L47 and check if a key is down like this https://github.com/BlackScorp/tiled2crafty/blob/gh-pages/kinetic/js/game/game.js#L77 dont think jQuery is just a framework to easy select ond modify DOM elements, jquery also has many crossbrowser stuffs inside
  3. i created a simple MVC Implementation without a framework, you can find the code here https://github.com/BlackScorp/MVC just import install.sql in your phpmyadmin, edit config.php and try it
  4. you have to clone the repository , then add the files , then commit it and push them back into repository. if you use Netbeans IDE you can do it like this: First select at the Top Navigation Team > Git > Clone .. in new Window copy the Repository URL(you find it https://github.com/Ayern/sRTS right bottom side) and type your github username and password in , then select a branch(usually master) and then select location on your PC(it must be an empty folder) , now youre done (and you schould have a project in the Projects tab on the left side in the IDE). Next step is to take your files and copy them inside the folder you cloned locally, now you will see that in the Project view in the IDE the filenames have Blue Color. Next step: Right Click on Project name select Git -> Add, Right Click again Git -> Commit, type something in Commit Message (e.g. Initial Commit) and commit your changes. Then Right Click again Git -> Remote -> Push.. and push it to github
  5. Well MVC was invented in 1969 Trygve Reenskaug told on his Keynote that it was not invented to use for entire Architecture, just for small parts (e.g. Inputfield,Button,Slider etc) therefore he extendet MVC and called it Data Context Interaction Pattern. Here is his Keynote to this Pattern The key of this pattern is to create for each real user interaction a custom class, if a user interaction requires more than one process you have to combine them into a context. Currently iam practicing the DCI Pattern in my Project https://github.com/Opentribes/Core/tree/develop/src you can see there a folder Interactor it contains user interactions on the webpage and the logic behind it. some of the interactions were combined into Context which is bound to a role, you can see the Context inside the Context folder. Each interactor/context has his own Request/Response class which contains properties at the end i took the interactors and used them inside controllers https://github.com/Opentribes/Core/blob/develop/silex/Controller/Account.php#L59-L71
  6. Creative Commons is mostly made for Graphical/Music Stuffs, in Code you have License like http://www.wtfpl.net/ http://opensource.org/licenses/MIT GPL AGPL BSD and so on..
  7. well i cannot download the project at once, and i dont want to download each file and wait 5 seconds on each file, maybe you can add a zip to download? (Version Control System like git would be much better but i gues it would be too much) just a side note http://php.net/manual/en/migration55.deprecated.php i would replace all your mysql_* functions with mysqli or PDO
  8. Quick Update, i had some problems with the Aglorithm to find a place of new city, i gues i fixed it now(at least unittest passed) so i deleted all existing cities Best regards
  9. thx, would look even sweeter if developers would help me (for example the Mobile view of map is broken)
  10. well iam currently building one Demosite: http://ot.blackscorp.de username: demodemo password: demodemo Code: https://github.com/Opentribes/Core feel free to contribute
  11. which issues? netbeans works very good on linux
  12. i know, but not everybody uses PHPStorm, i personally use Netbeans + Cygwin , well maybe someone want to contribute and create a wiki how to install it locally? iam not a native english speaker and my english is not good at all, the words i use does not looks professional :D
  13. well it depends on your operation system, if you use mac or linux, you just require php 5.4, composer and git, after cloning you can call make install-dev in command line and your game is setup. its also possible on windows but windows users dont user cmd.exe usually. howeever, on windows if you have xampp installed, you can install composer for windows. then you just add the xampp/bin folder in enviroment path and call this commands https://github.com/Opentribes/Core/blob/develop/Makefile#L14-L21 in your cmd.exe thats it   about cucumber, this is the core, the core should be tested, i will add a dummy module where an avarage programmer will just hack in and do his own plugins, if he want to implement unittests and behat, he can, if not, its ok :D the plugins can be made like the avarage programmer can programm
  14. Hello guys, view weeks are passed and i wanted to announce some Updates. Now if you login into game, you can create a city, after the city is created you can view your neighbours on a Map. Also i added now a logout button :D Next iam going to implement the Building feature, which means you can gather resources and upgrade your buildings. so stay tuned;) Best regards
  15. why? $validator = new Validator\Collection(); $validator->addRule('email',new Validator\Rule\Email()); $validator->addRule('email',new Validator\Rule\NotEmpty()); $validator->addRule('username',new Validator\Rule\MaximumLength(8)); $validationObject = new stdClass(); $validationObject->username = 'test'; $validationObject->email = '[email protected]'; $validator->validate($validationObject); if(!$validatior->isValid()){ var_dump($validator->getMessages()); } no factory, just handled by autoloader and still readable
  16. about drop one file in your project, thats why stuffs like composer are invented, you just dont care how many files a special approach contains, you just setup in your composer.json a library you require with a specific version and just install it. after it you dont need a factory, just call the namespace/class and the autoload basicly load the class. and smaller classes have the advantage to replace them quickly. I would suggest you to take a look at the SOLID prinziple, yes you have one file, but one file, means that one class has many Responsiblities, which again means if you change one part of that class, you have to change in worst case many parts in your code. (for example you dicide later to use an array for rules instead of explode a string by | as modifier or you change the modifier to , instead of | )
  17. I Think its a good beginn , but i see there some problem, you put the email validation and required into validator class itselfs, well there are pretty more stuffs to validate not just email and if you wish to extend the validator you need to add even more methods and someday your validator class will be too big. Instead i recommend to take a look at Symfony Validator, the validator has a validator collection class which accepts validation interfaces and each implementation have just one small method to validate a value. this looks then like this https://github.com/Opentribes/Core/blob/develop/silex/Validator/Registration.php#L27 also your current validator just got the inputs from $_POST which means youre not able to validate stuffs like, is unique username. therefore i personally prepare a simple object which takes some values from the database and the form and validate this object. @sniko instead of adding comments, write your code like a text and easy to understand, comments rot while code not just my 2ct ;)
  18. BlackScorp

    curl help

    well he use it , but it is useless there, since he think he can escape values for the URL..
  19. BlackScorp

    curl help

    it is not legal to crawl the webpage and parse the HTML Code.. if you want to use the search and data stuffs, therefore they made an API http://www.reed.co.uk/api
  20. BlackScorp

    Debug in PHP

    well you can install xdebug and setup breakpoints into your script inside IDE and then track you variables. also there exists FirePHP which allows you to display you values inside FireBug extension insdead on the page. also there are PHP/Apache logfiles which are often ignored
  21. But be carefull OOP is not OOP. Usually you learn stuffs like Some base class will be extendet by specific classes. take a look at this talks   novadays many developers realized that extreme extending cause dependencies, if you change some base class, this changes will affect other classes, sometimes it is required but often you will get unexpected results. instead of extending use Dependency Injection, which just basicly means you put some classes from outside in your class. also automated tests are important. for example you created a part of software and later someone else schould add some new features, well he could just hack some new features in your script, but how do he figure out if everything is working like expected? he can either, klick through entire gui und fill your forms with different values and take a look if he see an expected result, or he can just run tests and will see directly errors. also how could he know WHAT is the expected result if he is not familar with details of your software? again he can klick over gui but he is not able to understand if the result is like expected or not. there are many PHP Developers out there which are self called "hacker" "scripter" they dont care about those things, once you care, you could call you proffessional or "developer". Personally i learning tests and stuffs by my self, iam not a proffessional, but i want to be. i started a personal Project to study this https://github.com/Opentribes/Core everyone can clone that project and try it out, run tests, modify things and so on. Maybe this can help you a little bit out if you have some referencens, feel free to make issues or ask why a specific thing in the code is made like it is, negative feedback is good to learn, many ppl just start to ignore negative feedback and listen only to the good ones. if you accept them, then you can learn. just my 2ct
  22. https://github.com/Opentribes/Core/issues/37 added on my list, but first i have to make the game features ;)
  23. well it is not just a simple login/register/home page. as i told every input is tested automated my purpose is not to show a game, but a code. my goal is to provide a browsergame on professional level. for example, thx to the Repository Design Pattern iam able to replace any database engine(currently used mysql) to another with less efford. Companies like innogames pays money for consulting http://blog.innogames.com/a-fluffy-qafoo-training to create games this way. nvm i gues i made a mistake to post it here too early, i just expected that some Developers would do a little bit codereview and point me to some mistakes in early stage, so i would have less refactoring later.
  24. its in development, i started only 3 weeks ago ;) the idea behind this is to create a fully unittested open source browsergame (currently there is none on the internet, even if you purchase some games the code quality is really low)
  25. thx i gonna post some updates at the end of the week, https://github.com/BlackScorp as you can see i made everyday a contribution(like commited a code or opened an issue) btw the demo page is at http://ot.blackscorp.de/ but dont register there plz, since i gonna restart the database mulitple times anyways ;)
×
×
  • Create New...