
Lucifer.iix
Members-
Posts
46 -
Joined
-
Last visited
-
Days Won
2
Content Type
Profiles
Forums
Events
Everything posted by Lucifer.iix
-
Trying to think of a new battle system for mafia games =)
Lucifer.iix replied to Sim's topic in General
@Sim Ok, got it. (i think) But it's still 'turn based' or 'real time'.... `automatic` hasn't something to do with time. So, you want create a interaction between multiple people ? And they can interact with each other (shooting, robbing, etc) and with there surroundings. How does it start ? Do you make a script that checks for this. And than just start polling the server with the state of the battle, like every 2 seconds ? -------------------------------------------------------------------- Maybe you could also do this turn based.... It's like 'paper scissor rock'. - Shoot - Reload - Robb - Hide - Do nothing - Leave Scene (Hiden) - Shoot - Reload - Stay hiden - Leave position All in the same round. this repeats until all people are dead or exit. * You only can shoot at one person at a time. ** To mutch people doing the samething, like hiding for cover, they all do nothing ! So shooting is always possible, and if you hide you can't shoot but can be shot at, and have to wait till next turn. If your hiden you can only be shot if you start to shoot, but are better protected than normal. (So, you have to make it a little bit tacktical) -------------------------------------------------------------------- I was thinking about a shoot algoritm yesterday, just for fun. <script> var req = new XMLHttpRequest(); req.open('GET', document.location, false); req.send(null); var headers = req.getResponseHeader('date').toLowerCase(); var d = Date.parse(headers); alert(d); </script> With this i get the time from the server and can syncronise. Than i can create a algorithm than makes the `attacker` aim with time. So, you fill in a capcha, before, and than can shoot at a picture. But your cross-hair is moving around (with time from server) ! When you click the client will send the server time + time spent to the server again. And the server can check then if it was a hit and accuracy. -
I don't know, think text-based it self is a bit old school. My first computer games where text based ! And the first adventure games, had text like commands....So it's a bit old i think. People are not sitting behind there computer these days, but watching tv while playing on there iPad or smartphone. So, your game has to run on maybe on multiple platforms or devices to start with. But the mafia games are also a little bit boring and for kids only i think. And have to compete with Angry bird and other games. I don't mind, just going to keep on with my financial game. It's a highly grapical 2D financial shooter ;-) (And going to create bots, so i don't have a minimal of players needed for the game to work.) Happy Hacking: Roger.
-
Isn't creating your own game not more fun ? Maybe you learn something from it, that will give you a good job/carreer in the future.... Happy Hacking: Roger Keulen.
-
I like the responsive web sites from Zurb.com You can download there foundation: (Just select some dark gangster color's and you will get your CSS for free) Here is the custom download page: 'They will change some colors for you, number of columns in grids, etc...' http://foundation.zurb.com/develop/download.html#customizeFoundation http://foundation.zurb.com/ http://foundation.zurb.com/docs/ http://foundation.zurb.com/templates.html (<-- Empty layout's) Works also great on a dvice like your smartphone, just make the screen from your browser smaller and you will see it. Good luck finding your layout. Happy Hacking: Roger Keulen.
-
Hmmm, Don't think this is going to work for me. I don't own a machine, i own just a simple webserver with that crappy PHP. If i could install something else i wouldn't use PHP, and than i also have no problem using sockets my self. I can open en close a socket with php. But it's not a program, it's a script with a maximal run-time. I just going to poll for new messages, no problem. I really don't see a problem with that. Happy Hacking: Roger.
-
Sorry, i will take more care next time. Bertrand already said to me, that i can't wake up old threads... lol Thanx for putting them together in one post. Happy Hacking: Roger
-
@Dominion: Doesn't matter i'm not English. Here you go: http://uk.reuters.com/article/2013/10/08/us-microsoft-cybersecurity-idUKBRE9970YK20131008 So how mutch value do your credits have ? If i can choice between cheating and winning or 10 dollar, i will cheat and win the game. But for 50 dollar, who cares about the game.... It's also nice to be a `special` member for the game (maybe free play) and your name some where in the credits. Happy Hacking: Roger. Ps: I will always tell, i don't care about games. Like programming to mutch for that.
-
Coly010: if you want i can look at it why it's so slow. I'm building my own chatclient right now. But it's just for fun and i always can reuse the library functions. Happy hacking: Roger. Ps: I have a server running... http://rogerkeulen.nl or http://fmmorpg.nl So it's not a problem for me to install it. But only if it doesn't have to go into the root directory. (Don't want to mess up my server with scripts/expriments that can't be moved)
-
@Danny696: Restyled your password class a bit.... <?php class password { public static function createSalt($length = 20) { $charactersUsed = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; $salt = ''; for($i = 0; $i < $length; $i++) { $salt .= substr($charactersUsed, mt_rand(0, strlen($charactersUsed)-1), 1); } return $salt; } public static function createHash($username, $password, $salt) { $uniqueHash = hash('sha256','<<< please put something here unique here, like your hostname url >>>'.$password.$username.$salt); $hashStrong = ''; for($i = 0; $i < 10; $i++) { $hashStrong.=hash('sha256',$hashStrong.$uniqueHash); } $hashResult = ''; for($i = 0; $i < 500; $i++) { $hashResult=hash('sha256',$hashStrong.$hashResult); } return $hashResult; } } ?> Thanx for sharing, dude ! Happy Hacking: Roger.
-
Sending small messages wouldn't normaly be a large problem for a server. That's where they for. Just write good code that does what it should do and no more than that. On the client side you could create this with AJAX/Java direct in your browser. node.js looks a bit overkill for a chat client. HTTP is already supported by the browser, if you created it with JavaScript. Only if you want to have your own transmission protocol 'node.js' could be a choise. Coly010: is this for your: Bitten Text Based RPG ? Maybe i also want to have a chatservice in my game. Than you can have mine, but i'm also still `designing` the game. I'm only testing/programming the stockmarket part of my game/platform.
-
@ sorry, bertrand didn't saw it. I just was browing the list and respondig. I will look at it next time.
-
Maybe a strange question, but why do you want to have this, if it's already your own site ? http://mysite.com/users.php?startid=1&endid=12345 http://mysite.com/users.php?startid=12345&endid=1 Happy Hacking: Roger
-
And how would you know it secure or fixed ? And when do you going to pay him ? When you think it's secure or he says so.... Why not just make the price you get reporting a bug to you has more value than the billions of fake credit. That is what all the other companies like google and MS are doing... Happy Hacking: Roger.
-
Whahahah, no dude. The BUG isn't on screen, it was in his database. So the question he asked wasn't a question. He ask why isn't this code working. The code was working correct ofcourse, but he had other problems. But you didn't start the topic. So it isn't intended for you. Happy Hacking: http://RogerKeulen.nl
-
@HauntedDawg: a bot with lot of typo's i see.... hmmm. (But i'm going to leave them there...) Happy Hacking: Me !
-
Yep, works... Only not loging in chrome. Can login with debugging in Zend studio (i think he will use a old internet exploder). Welcome back Admin. The last time we saw you was on 1 January, 1970, 1:00:00 am Engine news. Last 5 logs No news as of yet. Event Unknown column 'log' in 'field list' DB: http://rogerkeulen.nl/engine.mwb <-- MySQL workbench [http://dev.mysql.com/downloads/tools/workbench/]. Happy Hacking: Roger
-
Btw: This isn't a ENGINE, looks more like a game. With a Engine you can create for example Text based browser games or 3D shooters. This is already a game, with items like: Jail, bank, hospital.... lillte bit clueless what it al does. But coding is clear enough to understand what your doing. So far i have: (USERNAME = "admin", PASSWORD="test") SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; DROP SCHEMA IF EXISTS `engine` ; CREATE SCHEMA IF NOT EXISTS `engine` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ; USE `engine` ; -- ----------------------------------------------------- -- Table `engine`.`users` -- ----------------------------------------------------- DROP TABLE IF EXISTS `engine`.`users` ; CREATE TABLE IF NOT EXISTS `engine`.`users` ( `userid` INT NOT NULL AUTO_INCREMENT, `username` VARCHAR(45) NOT NULL, `password` VARCHAR(200) NOT NULL, `salt` VARCHAR(45) NOT NULL, `laston` TIMESTAMP NULL, `last_login` TIMESTAMP NULL, `last_ip` VARCHAR(20) NULL, `level` VARCHAR(45) NULL, `access` VARCHAR(45) NULL, `money` VARCHAR(45) NULL, `tokens` VARCHAR(45) NULL, `messages` VARCHAR(45) NULL, `logs` VARCHAR(45) NULL, `bulletins` VARCHAR(45) NULL, `work` VARCHAR(45) NULL, `bank` VARCHAR(45) NULL, `jail` TIMESTAMP NULL, `hospital` TIMESTAMP NULL, PRIMARY KEY (`userid`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `engine`.`email` -- ----------------------------------------------------- DROP TABLE IF EXISTS `engine`.`email` ; CREATE TABLE IF NOT EXISTS `engine`.`email` ( `emailid` INT NOT NULL, `userid` INT NOT NULL, `email` VARCHAR(45) NULL, PRIMARY KEY (`emailid`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `engine`.`user_bars` -- ----------------------------------------------------- DROP TABLE IF EXISTS `engine`.`user_bars` ; CREATE TABLE IF NOT EXISTS `engine`.`user_bars` ( `user_barsid` INT NOT NULL, `userid` INT NOT NULL, `energy` INT NULL, `maxenergy` INT NULL, `audacity` INT NULL, `maxaudacity` INT NULL, `health` INT NULL, `maxhealth` INT NULL, `exp` INT NULL, `maxexp` INT NULL, PRIMARY KEY (`user_barsid`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `engine`.`logs` -- ----------------------------------------------------- DROP TABLE IF EXISTS `engine`.`logs` ; CREATE TABLE IF NOT EXISTS `engine`.`logs` ( `logpk` INT NOT NULL AUTO_INCREMENT, `number` INT NULL, `text` VARCHAR(45) NULL, `param1` INT NULL, `param2` INT NULL, `param3` INT NULL, `parm4` INT NULL, PRIMARY KEY (`logpk`)) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; -- ----------------------------------------------------- -- Data for table `engine`.`users` -- ----------------------------------------------------- START TRANSACTION; USE `engine`; INSERT INTO `engine`.`users` (`userid`, `username`, `password`, `salt`, `laston`, `last_login`, `last_ip`, `level`, `access`, `money`, `tokens`, `messages`, `logs`, `bulletins`, `work`, `bank`, `jail`, `hospital`) VALUES (-1, 'admin', '1c26a6623465391145025d5d79c717d82511a88cabe3239a38f5a4959731fc1a5b02a93b003f82899dfdee7d34588c0fc8627a2ebf021693b9110469654830ef', '1234', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); COMMIT; -- ----------------------------------------------------- -- Data for table `engine`.`email` -- ----------------------------------------------------- START TRANSACTION; USE `engine`; INSERT INTO `engine`.`email` (`emailid`, `userid`, `email`) VALUES (-1, -1, '[email protected]'); COMMIT; -- ----------------------------------------------------- -- Data for table `engine`.`user_bars` -- ----------------------------------------------------- START TRANSACTION; USE `engine`; INSERT INTO `engine`.`user_bars` (`user_barsid`, `userid`, `energy`, `maxenergy`, `audacity`, `maxaudacity`, `health`, `maxhealth`, `exp`, `maxexp`) VALUES (-1, -1, 5, 5, 5, 5, 5, 5, 5, 5); COMMIT;
-
@Danny969 Great, maybe i going to try to run it. (Just for fun) And post it right here.. Ps: i going to remove your password. (Please check, it isn't used anymore !) Happy Hacking: Roger
-
What are your strongest programming language?
Lucifer.iix replied to Script47's topic in Question of the day
PHP isn't a programming language it has a 'C' syntax, not a PHP syntax developed by them. And it's also horibble: function MyFunctor() { return function() { return "hello"; } } // <- Doesn't work. function MyFunctor() { $PHP_IS_HORRIBLE = function() { return "hello"; }; return $PHP_IS_HORRIBLE; } // <- this works. MyFunctor()(); <- This doesn't work... $PHP_IS_HORRIBLE = MyFunctor(); $PHP_IS_HORRIBLE(); // <- And this does ofcourse... PHP is just a TEXT PROCESSOR with a scripting language that must look like 'C' and now 'C++' syntax. Now this year it looks stable, but your old code will run until your hosting provider get's a update. Than you have to re-arange all your parameters. Who can remember the day that they changed the parameters of: explode($array, $delimiter) to explode($delimiter, $array).... And that wasn't the only time i had to re-arange params because the people of PHP tought it would be handy. With mysqli is exactly the same, you can't just: Replace all "mysql_" with "mysqli_", that would be just to easy. XML (HTML/CSS) is a MARKUP LANGUAGE. MySQL and MySQLi is a Provider/Driver for MySQL, not a programming language. It's just a API or Interface with your database. Even SQL is a QUERY language. And Quering isn't programming. Queriing is asking a question, not controlling the flow of a process. Java, ok you can call that a language. But don't forget to update ! Java Script, is just a scripting language that run's in a sandbox. It's comparable with PHP and also PHP's developers example language. JQuery is a library/Api from google or used by google for queriing the DOM (Document Object Model) better, than with the normal DOM implementation. Like getting al the elements from a class inside a small piece of html, so not the whole document for example. And it has some special ($) labda functionality for chaining of functions. JQuery isn't a language, but it's mutch more professional than all the things listed above. Good languages: Clojure, F#, C#, Delphi, Visual Basic (only VS2010 and above ofcourse), Phyton, Ruby on rails. What does a good programming language have. The same things we have in math, like types, sets, transformations and functions. @Dayo: No, not really. If you don't know the difference between programming and markup it's also difficult to awnser. - - - Updated - - - You *******, don“t touch my: "widely-used general-purpose scripting language" ;) Happy Hacking... -
Maybe try-it like this... It's with 2 exceptions. One is fatal, the other one will give you a MySQL error number and a message. class eFatalException extends Exception { public function __construct($message) { parent::__construct($message); } } class eDBException extends Exception { public function __construct($message, $code=-1) { parent::__construct($message, $code); } } class clsDB { protected $prvLink; public function __construct($host, $username, $password, $schema=null) { if($this->prvLink = mysqli_connect($host, $username, $password)) { if(isset($schema)) { $this->selectSchema($schema); } } else { throw new eFatalException("Could not logon."); } } public function query($sql) { if($result = mysqli_query($this->prvLink, $sql)) { return $result; } else { throw new eDBException(mysqli_error($this->prvLink), mysqli_errno($this->prvLink)); } } public function selectSchema($schema) { return mysqli_select_db($this->prvLink, $schema); } public function link() { return $this->prvLink; } } But, how do i know it will give me a exception ? Because of the other part of coding..... called: testing ! (It comes after designing, but before documenting) // ----- Test params ----- $host = "127.0.0.1"; $username = "xxxxxx"; $password = "xxxxxx"; $schema = "xxxxxx"; // ----------------------- // 1 - First test: what is going to happen when we try a big pile of BS.... Expected: eFatalExeption ! try {$DB = new clsDB("ThisIsNotMyServer^%&*(()!!!!","MyNameIsNothing", null, "Yes, please!"); } catch (eFatalException $e) { $Test1Passed=true; } catch (exception $e) { $Test1Passed=false; // <-- Just testing... \o/ (You never know, have seen stranger things....) } if(!$Test1Passed) { echo "FAILED - DB Connection Test 1 - eFatalException expected but not catched.\n"; } // 2 - Next: Let's try to logon with no schema..... Expected: getting a valid connection. try {$DB = new clsDB($host, $username, $password); } catch (exception $e) { echo "FAILED - DB Connection Test 2 - exception not expected.\n"; } if(!isset($DB)) { echo "FAILED - DB Connection Test 2 - Valid connection Link not returned.\n"; } // 3 - Let's try to select a schema. (Warning: Dependend on previous test) if($DB->selectSchema("not_existing_schema")==true) { echo "FAILED - DB Connection Test 3 - not existing schema selected.\n"; } if($DB->selectSchema($schema)==false) { echo "FAILED - DB Connection Test 3 - could not select schema\n"; } // 4 - Let's try to query BS try { $DB->query("Hello db, can you give me some records.... please.... please...... please with a little bit of shugar on top ?"); } catch (eDBException $e) { if($e->getCode()==1064) { $Test4Passed=true; } } if(!$Test4Passed) { echo "FAILED - DB query Test 4 - eDBException expected with MySQL error 1064 `syntax error`.\n"; } // 5 - Let's try to query something that actualy works. try { $result=$DB->query("SHOW TABLES"); } catch (eDBException $e) { echo "FAILED - DB query Test 5 - no eDBException expected.\n"; } if(!isset($result)) { echo "FAILED - DB query Test 5 - result expected, check your selected schema if there are actual tables in it !\n"; } Happy Coding: Roger. @ Coli010: $db->query("SELECT * FROM users WHERE userid = '$s_id'"); Is this the DATA for the user it self ? Maybe store this in session vars, a `relational` database is for storing relations. For storing data we use files a very long time. :D You can remove the switch or IF-Branching with a interface. Like: iNotifiable and that has a method called: Notify($u_id, $***, $sid, $t, $ot, $grrr) or something more explaining..... like: Notify($thisPerson, .....) *switch ($type) ****{ ********case 1: ************friend_request($uid, $s_id, $type, $other); ************break; ********case 2: ************new_pm($uid, $s_id, $type, $other); ************break; ********case 3: ************new_chat($uid, $s_id, $type, $other); ************break; ****} interface iNotifiable { public function sendMessage($fromUserID, array $toUsersIDs, $messageParser); // <- Or something like this. // Make API not to specific and use lists if possible. Send One or Multiple messages in one API, reduces duplicate functions that do the same things slightly different. } class cPersonalMessage implements iNotifiable { public function sendMessage($fromUserID, array $toUsersIDs, $messageParser, clsDB $db) { $toUserID = array_shift($toUsersIDs) // <-- Personal message has only one reciever ! $message = $messageParser($fromUserID, array($toUserID)); // Parser expects multiple ofcourse ;-) $db->query("insert into `notifications` (toUserID, fromUserID, message) Values ($toUserID, $fromUserID, $message)"); } } // Usage: // Script that read's the input from user. (But is clueless about WITH db or USER or other stuff, SEPERATION OF LOGIC keeps the code clean !) $a = new ........? <- something that is iNotifible (Like a PM message or other notification message) // Here we do need a handle to the DB and the userID from the people to send a message. But we don't care about WHAT message it's is. One code for ALL messages, no IF-Else trees. try { $a->sendMessage(...,.... } catch (eDBException $e) { echo "***?"; } The IF statement is moved to a better location.. the creation in the beginning. So code doesn't know or say all the different type of messages. Makes the code messy and hard to maintain. What's the difference. Adding a new message notification in the future. I only have to implement a interface with the correct API and i'm done. Happy Hacking: Roger. Ps: If you inject all your dependencies like: function WhatDoIDo($INeedAFileName, $INeedADelimiter) // <- Maybe loading a file and explode it with a delimiter perhaps ? Than you have less to document. Because i know that i'm not going to use `global`. So this function isn't going to logon in a database without knowing. Or do other strange stuff thanx to `side-effects`. Like filling in your password and username at the wrong host. :o (The best passwords to store are the ones that didn't work. \o/) Brainfood: http://en.wikipedia.org/wiki/Side_effect_(computer_science) http://en.wikipedia.org/wiki/Dependency_injection Ps: before i going to sleep. You don't need objects ofcourse. $messageSender = function($fromUserID, array $toUsersIDs, $messageParser, clsDB $db) { ... enter specific MESSAGE code here.... } .... some where else .... $messageSender(...,...,...,...); <- Does not know what type of message it is. So when you remove a type. This isn't the place to look for bugs ! (The implementation is at 1 place, for every message type) According to tests of the owner of this site, it will be 46% faster than the OOP aproach. (But learn that first, it's more used than labda expressions) Happy Hacking: Roger But before we going to try to make better and cleaner code out of this let's do a grand re-design.... (1) - Your putting HTML code in a database. But HTML is a markup language, example: <div id="notify_new"> <script data-interval="5000">getPageID("notify_new","notification.php?id=last")</script> </div> This will get do a request every 5 seconds and if he get's HTML result he will parse this in the div with id="notify_1". The result it self could be the HTML you want to show with the data inside it. But the next thing is also posible: HTML (Template to fill in, already in HTML but you can't see it.) <a href="javascript:void(0)" id="notify_link"><h1 id="notify_title"></h1><p id="notify_text_short"></p></a> <script data-interval="5000">getXML(notification.php?id=last")</script> XML: (Until we fill it in with a XML file) <singleItem> <notify> <link onclick="getPageID("main-content", "showNotification.php&item=1")"></link> <title>Isn't this game boring ?</title> <text_short>Yes, it is a boring game, i....</text_short> </notify> </singleItem> Thus: you only need files for this, not a database. (connectiong to db cost a lot of time, filesystem is also a database for storing files in directories.) Just make a XML file for every user that get's a message. The script will check every 5 seconds if the user has a message. If he has he will give back the XML of the newest. (order by filemodification date) Root\Users\$UserID(from session)\Notifications\ <- Xml goes in here, and let's say: 50 files is max, so we going to delete 51th file and more from old to new. ------------------------------------------------------------------------------------------------------------------------------------ (2) Your getting user info from db that doesn't change. Maybe try to store this in session varables. But WARNING: Not to mutch. Loading session vars also cost performance. (So, don't store the actual picture in it!) That way we can do a lot of stuff without connection to a database. Maybe the user just needs a private file that he only can see. You only need his id to find the right user folder. But because this is a `security` thing you want to have proper TESTED functions. So you know nobody can cheat in your game, or take controll. So the function has to deside if the person is loged on, if not he is always a GUEST. So, no `null` or empty array. Makes your code very messy with: if(isset(pileofBS)) {...jada, jada, jada.... Thus not loged on, no problem. We have a dir for guests that's empty or what ever. or the same files than normal but with content: <body><h1>please logon (you bastard)</h1></body> That way you don't need IF-Then-Else statements for every thing a user does. One go for all users, loged on or not. Makes code less specific, and you can see the FLOW of the program. Not the special cases. --------------------------------------------------------------------------------------------------------------------------------------- (3) Inserting into database isn't `game` logic. Please seperate ! You have a MySQL database now, but what if they change that. Or the people from PHP going to create: MySQLiExtensionOfMySqliExtendingTheOldMySQLiButExtendedWithTheParamsUpSideDown What you wanted to is ? NotifyPersons, or not. Than call it also that way. So you have a: function notifyPersons(...,..,..) and that function is going to call a OTHER function. Example: toFile::notifyPerson(..,...,..) or toDB::notifyPerson(..,...,..) or testFramework::notifyPerson(..,...,..) So in: PHP GAME file -> there only call's to `notifyPersons` but NO implimentation. Only the API/Interface what you going to send/need to do this, just like MySQL is a interface in PHP. (Gang of Four: 1994) Then in your: Database Model File, you can insert these values. In your filesystem file: You can append this to a Log file. In your testFramework file: You can store all `links` (dependancies) and check them if they work. Check HTML for non html5 compatible markup. You name it. If you have the idea's, you can automate almost everything ! What file he is going to be used is desided by the `CONTEXT` your program is running in. Like: $WhatTimeIsItInTheGame = function() { return Time(); } $Context = new context($WhatTimeIsItInTheGame, ) <-- production/running game $TheFirstDayOfTheMonthBug = function() { return '1-1-2010'; } $Context = new context($TheFirstDayOfTheMonthBug, ) <-- testing/debugging a bug a user found yesterday $context->notifyPersons(getUserId(), $usersToNotify, $message) '<- What is this going to do ? I DON'T KNOW, AND I DON'T WANT TO ! (If i know: "i'm dependand on it") So, we have `notifying` a person loosly coupled from the game it self. Thus if you need a notification system in the future. You don't have to develop/write/test/document a complete new one. This system doesn't know about DB, File or Mafia Game. So it doesn't care about these things. It's decoupled and generic if designed correctly. Happy Hacking: Roger. Brainfood: http://en.wikipedia.org/wiki/Coupling_(computer_programming) Wiki quote: "Low coupling is often a sign of a well-structured computer system and a good design, and when combined with high cohesion, supports the general goals of high readability and maintainability.[" Exelent: Make a proper function or class out of this and your hired ! Fixing bugs takes more time than programming. But only the people that have actually completed something know this. Don't code for speed, code for readablility (what does this do), maintainability (how can i add functionalitity to this) and stability (what goes wrong when this isn't going to work somehow ?). If your finnished product isn't fast enough. It's easy to find the slowing downpart. It's mosly the most used part not to worst coded part. So you only can do real optimalizations with performance, if it's ready and you know what is going to be used when, and how often. Happy Hacking: Roger @Alan: Consider:vsNot an elegant way of displaying error messages I admit, No problem, make 2 functions out of this. One for production the other for testing/development and other stuff. Swap the function before shipping, and your done. Happy Hacking: Roger. Ps: The time you spent writing elegant error system, can also be used to keep the error's out of the project. I reather write a test that i can re-run after every change, than creating a fansie a error system. Becasue when your ready to ship the product, your error system should be empty. (At least try to....)
-
No, i'm just doing this more than 20 years. I'm a software tester, so i have to read code for a job. Btw: "the gang of four" is a good topic to google on. If your intressed in programming patterns. (or learn about anti-patterns like the `Singleton`) Happy Hacking: Roger.
-
Sorry, i have writen this wrong. You didn't say this. You said, i'm using php i want to move on, give me a good OOP language to learn. Than i would say: "Visual Basic or C# in Visual Studio 2010/2013 (.NET 4.0/4.5) is good enough and has a awesome IDE (Visual Studio)" But if you don't want the big IDE and SDK, go for: Python or Ruby on rails. But before you start and buy some good books..... Like: "Design Patterns: Elements of Reusable Object-Oriented Software, 1995 by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides ("Gang of Four") Terminology invoking "objects" and "oriented" in the modern sense of object-oriented programming made its first appearance at MIT in the late 1950s and early 1960s. so, it's extreemly old. how old, 1kb of memory kind of old. For example the latest programming language of Microsoft in Visual Studio is F# and that's a functional language. The reason is very simple. Create a object that's a list. Now do a foreach loop on that list and add something from the rsult to that same list. And now ask your self, how does he going to devide this process over multiple CPU's ? Awser, with a lot of work (overhead) and luck (thread-races). And that has to do with that objects are references (locations in SHARED memory) just like a database. So, yes: you need transactions, cloning, locking and all that stuff just to make it work. With functions (real functions) you don't have that problem. There is no difference between a value or a function. So, if you want to learn a language that can also be used in the future. Take something that also run's on a GPU or Multi-Core CPU. Because where getting more slower cores than less faster ones. Your OOP program will only getting slower and slower runnning on that one (and a bit...) core. Happy Hacking: Roger Inventor of Linq has a nice vid on you tube: This is closjure, but it's for experts: Ps: This changed only 11 years ago. 2002 was the last breakthrough in creating smaller IC's. Where arrived at Quantum size, and can't get smaller without quantum effects. (And we are going to use this within 60 years from now.)
-
Your asking: "I want to know the best language, but it must be OOP because that is the best ofcourse" ? Why ask if you already know the awnser. Tip: The lasting you need to know in a multi-core world is a old fasion programming paradigm that uses references.
-
I think it's a great idea. Just make a translate button on the message it self. Don't see a problem with: "pow, pow" or "poef, poef". Just make shure people of different languages don't post in same forum or by language. And if it's not your language, push the button and hope you can understand it. This way your game has a lot more people in it. Than having a lot of games with small groups of people in it. Specialy if you make it for little kids that can't speak english that good. Good luck with your game. Happy Hacking: Roger.
-
I don't know. It's like PHP, no types, no structure and version numbers that change faster than dayofyear. If you like 'clean and dirty' coding, you like it. If you like your customers, i wouldn't touch it. Next language, i going to learn: http://clojure.org/ And maybe F# from MS, but you not really need to learn that. It speaks for it selfs... Happy Hacking: Roger