Overclock.net banner

1 - 13 of 13 Posts

·
Registered
Joined
·
266 Posts
Discussion Starter #1
I am looking screw around and make something similar to MafiaWars on Facebook and I was just wondering what you think it was coded in?

Is it PHP + MySQL? For some reason I don't think it is, but prove me wrong.

If you've never played MafiaWars, it's like this:

You start with energy and do jobs...doing jobs gives you money. Every few minutes your energy is increased, allowing you to do more jobs if the amount of energy you build up allows it.

Ideas?

*edit*

The main thing I want to figure out is the adding energy every 'x' minutes. Is that something you can do with MySQL or PHP or is there something else going on in the background?
 

·
Premium Member
Joined
·
11,272 Posts
Or neither, considering it's a Facebook plugin.

You should just look up what Facebook plugins are written in, instead of asking here... that seems to be the obvious course of action...
 

·
Registered
Joined
·
266 Posts
Discussion Starter #4
I don't necessarily want to do it for Facebook, so I guess I want to ask what the best way to do it as a standalone website would be.
 

·
Registered
Joined
·
63 Posts
the best way to do this would depend on the platform you use on the server... for most configurations PHP/Mysql would be the best bet, though writing a server in C is also possible for example... just a tad more complicated
 

·
Registered
Joined
·
63 Posts
Quote:

Originally Posted by DanC View Post
The main thing I want to figure out is the adding energy every 'x' minutes. Is that something you can do with MySQL or PHP or is there something else going on in the background?
there are a few ways to do it. The best way i can think of, is checking every time the page is accessed how much time has passed since the last access, and adjust the values then. Unless you write your own server, I don't see how you could do this in the background at all.
 

·
Premium Member
Joined
·
11,272 Posts
PHP is probably the easiest to pick up from scratch. It was my first language. You probably won't grasp (or even need to use) stuff like object-oriented programming, but it has that too. It's a good introduction to programming because it takes care of data types and stuff for you.

For example, to add two whole numbers in Java would be (very similar in other languages like C++):

Code:
Code:
[CODE]
public static int add(int a, int b) {
return a+b;
}
[/CODE]
Whereas in PHP it's only:

Code:
Code:
[CODE]
function add($a, $b) {
return $a+$b;
}
[/CODE]
 

·
Registered
Joined
·
3,618 Posts
But according to your post they're both php COMA


(fix itt
)
 

·
Premium Member
Joined
·
11,272 Posts
No, that's just the vB tag. The
Code:
 tag doesn't do highlighting, so I used [php] for both.

For starters you need to learn the basic stuff, forget objects for now. Check the tizag.com PHP tutorial to get started.
 

·
Registered
Joined
·
2,703 Posts
I'ld say start out easy and make a Java Applet (or whatever the web start stuff is, been too long) and connect that to some sort of OOP language that controls your database and connections. You could then have the Java check for updated numbers periodically or, less likely, push the changes.

Or have some sort of super fun PHP, AJAX, MySQL program creation party.
 
  • Rep+
Reactions: 66gto
1 - 13 of 13 Posts
Top