Jump to content

Recommended Posts

Hi all. I want to have a go at creating a couple of website games. Nothing too technical but looks graphically pleasing and is fast/responsive, for multiplayers. Games like 4-in-a-row, tower defense games etc. I have read around google etc and cant come up with a sound solution. So if anyone can answer these questions please do:

1) What language should I use? java, javascript, c++?? Consider that I need it to work in multiplayer mode...

2) I would also like to keep records of scores etc in a database, roughly how is this done?

3) Can you recomend a good book to buy that will teach me how to build these relativly basic games with the recomended language?

4) Also how complicated is it to deal with different platforms/browsers, and colour interperetation? I have read some gobblyde gook about 16bit things, etc that just dont make any sense in what you need or how to implement it.

 

I think basically what Im asking is what book should I buy LOL.

Thanks...

Link to comment
https://forums.phpfreaks.com/topic/159897-solved-good-gaming-language/
Share on other sites

Ok I have decided to create java games. So I have downloaded the JDE 6.0 version with Netbeans. Now every tutorial I find on the net approaches things very differently. Yet they all claim to create the 'HelloWorld' screen. Now I need to creae this helloworld class as an applet but there is NO option in netbeans to create an applet, all there is is an application which I have read is not what I want.

 

Is there anyone here with experience with java that can just teach me what the hell I actually need to do to create an applet, and have it show on a html page. Because when I try to import a class into my html directory it will not let me do this.

 

I feel like having a rant at all the useless tutorials out there which just miss out on important information like this for begginers, but I will hold back because im too annoyed to even type anymore. Thanks.

I cannot get any applet classes to run even a simple:

System.out.println("Hello World!");

will not work. The error I get on the html page shows : invalid magic number 1785632 somthing like that.

 

Other class files I have made give different errors.

 

I have compiled it in netbeans and it all shows to be correct. I have copied the class file that is created to my html document tree, and then called that class in my html document. So why does it not work? Here is my main class for the hello world:

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package helloworld;

/**
*
* @author Administrator
*/
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("Hello World!");
    }

}

 

can someone please tell me why this isnt working? Im fed up of struggling to get simple things to work, only to find out that u have to do somthing simple yet NO ONE explains it in the beggining. I want to just work on problems with the actuall program not how to do simple stupid things like this....

 

 

I think you are confusing an applet with a stand alone java app, your code is for a stand alone java app.

All the examples I find online(not sure about applets since it's not very common these days and I only create stand alone apps in java) seem to start like so

import java.applet.*;
import java.awt.*; 
public class Main extends Applet
{ }

notice the extend applet?

 

Then to run this in your browser you use the <applet> tag to run it

interesting, thanks very much for you advice guys. So you can still create great games in flash? And also multiplayer games?

I think the flash language is a much easier concept to grasp than java, at least last time I looked at some flash code.  Just have to shell out the £100 to buy it, but at least will be able to do some other cool stuff for my sites...

fry2010,

  You actually don't strictly *need* to buy flash, although for making a lot of the assets I'm sure you'll eventually want to have in, however, you can now use the flex sdk to compile actionscript.  As for games, I worked on this site, where the games parts are flash:  http://pickteams.com/#home

 

There are sites like these:  http://www.omgpop.com/  or http://www.kongregate.com/games/preecep/desktop-tower-defense-1-5 or the grand daddy of this idea: 

http://www.newgrounds.com/portal/view/59593

hmm... i just looked at flex briefly and it appears that adobe also sell a flex builder, which im assuming is a similar principle to dreamweaver, i.e. a waste of money.

Those sites you list are exactly what im after. So you think I can create decent multiplayer games using flesk to compile my action script code?

Does that mean I will need to hand create the animation files to use and then use notepad to write the actionscript?

Can I create the animation files with gimp?

It might just be easier to buy the flash package...

Also if you have read a book on flash which would you recommend?

your advice is greatly appreciated, thank you.

Actionscript files are simple text now, so yes, you can write them with any editor.  Flex is actually more than just Actionscript -- it includes the mxml markup language, and was designed for people to build applications.  So a lot of flex builder is designed to support the mxml, in a, as you said, dreamweaver like fashion.  You certainly don't flex builder to write actionscript code, although people that are doing a lot of it have told me they like it.  You can also run the flex builder as a plugin to eclipse which is the IDE I personally use these days, although there is also a free actionscript plugin named ASDT that gives you some solid support for actionscript syntax.

 

For external assets, you can bring them into the .swf using the [Embed(source="...")] or there's a loader class that lets you load external assets at run time.  So you don't strictly speaking absolutely have to package all your assets using flash.  Chances are you will still want to get a copy of flash, but strictly speaking, yes you can develope full flash swfs without it.  This assumes that a lot of your games are going to involve programmatic manipulation of sprites.

 

For books:

O'Reilly's essential Actionscript 3.0, and there's a book on games specific development called Actionscript Game programming university that's a pretty quick read and has some great example apps.

 

 

 

 

 

 

 

Yeah I think i will just buy flash, that all sounds too complicated to me using flesk. I have the trial version and made a simple game already. Just shows that it took me 3 days to even get a screen showing in java and has taken me about 3 hours to get this game in flash. I think flash is the way to go.

Its a bit tricky to create nice looking graphics though, I suppose I will have to learn it or create images in gimp and import it maybe. Thanks for your help gizmola. Will pick up one of those books too.

I have to say Flex Builder is to ActionScript and MXML as Zend Studio is to PHP.

 

Both are based on Eclipse, Flex Builder is build to make developing in code simpler, if you plan writing losts of Actionscript, Flexbuilder will be a god send. I speak from experience, it is a development tool to write code, its based on eclipse, so if you have used and eclipse editor before it will be the same, except its tailored for MXML and AS3.

 

You can create assets in flash and export them as SWC files and use them as objects by referring to them in AS3, or you can write standalone classes that you can use in your Flash IDE, while developing your assets... :-)

 

Theres Also FlashDevelop IDE, and other open source ones, but anyway you go you can compile SWF files with the Flex SDK.

 

Cheers!

First congrats on getting your first game demo out.

 

Just one last question do you know how to stop people hacking flash games like with cheat engine etc?

 

I'm not sure what you mean by that.  Of course, Flash runs on the client, and there's no way to control the client environment.  If it's a network game, you can take steps to encrypt/decrypt the client protocol, but at the end of the day, you can't really prevent people from doing what they want to something running on their own computer.

DarkSuperHero, thank you for the explanation but flex builder costs about the same as flash so I think it will be easier to buy flash, even though I can do other stuff with flex.

gizmola - the game was only from an online tutorial but it felt pretty good to actually get somewhere and have an operational game. Also I think I have thought about a possible way to stop people cheating is to compare the values that are set including setting variables for other such things and compare these, and if they dont match up then there has been some cheating going on. Just going to have to think about how to implement all this together, because I also want to do a ranking system, award system etc.

One other problem I have is creating a 'challenge' button in the pre-game arena, so that users can challange each other to battle, much like on www.flyordie.com. The only way I can think about doing that is to use ajax to pass the request to the user, and also to send a response back. This is going to be a hard one to do. Either I some how need to store the challenge request in the mysql database and then use ajax to print out the 'challenge' message to the end user, or somehow find the specific user to send the request to. If you get what i mean I would be suprised, but its difficult to put into words.

The problem I see with the database method is there will be many connections and edits to the database which is no doubt going to slow down my site, so I think dynamically finding the specific user that the message is intended to, is the way to go. That in itself will be quite hard, I mean for example:

 

I have 10 users online in the game 1 arena. Player 1 challenges player 2, so how do I send this challenge request message to player 2 with the use of ajax?

There is another alternative, which is to use flash to do all this, because flyordie.com use java to do this. I really cant tell which is the best way to go about this, so if you understand me (id be amazed if your still reading!), then let me know the best way you think to do... lol.

 

Ok thanks for your help guys....

If you plan on using the HTTP protocol for all of this, you cannot do user<->user interaction.  It will have to go user<->server<->user.

 

 

Essentially a script will have to check if there are any challenges.  You could display it multiple ways... but...

 

Anyway, you basically will have two options as for displaying challenges if you plan to do this all over the HTTP potocol.

-Check each page load.  It would be kinda lame since users would have to constantly refresh.

-Have an AJAX script check in the background for new challenges.

 

How you did the AJAX part would give different options too...

 

-Generic check every x seconds requests

-Long polling

 

(Technically there could be other options, but those would be the most viable.)

yes corbin! thank you for understanding...

 

The problem though is still the same in my mind:

 

Lets say a user goes into the page. I collect his name, using ajax send it to a php handler file and then output the request to the intended user. Do a reverse of this if the player accepts this challenge.

 

But the question is: Will the ajax be able to contact the intended user? How can I make contact with the specified user with just their username? I know that this could easily be done with using a MySQL database, but what if I get 500 + requests (Ill be lucky!), then it will slow the server down. How can I not use a database for this? If you get me....

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.