Making some basic Java games

Can anyone help on how to make some basic java games for my website if you could that would be helpful
thanks,
Louie

Well, first of all you program the Framework, add Graphics / sounds / Data , then you put it in your HP - There you are!

Similar Messages

  • Plese help! Stuck on some basic Java homework...

    I am taking this introduction to java class and we were given 3 homework assignments and I am really stuck on 2 of them.
    One of the assignments asks to make a index.html page that will connect to a mysql database for coffee/suppliers.
    The first part says:
    Create the index.html to create the following web page. After a user selects
    Espresso and 5 pounds, and clicks �Submit Order� button, he/she is going to see the
    following URL:
    http://localhost:8080/hmwk09/coffee_processing.jsp?name=Espresso&pounds=5&Submit=Submit+Order
    (which I sort of completed physically with dreamweaver. im not sure if i need to embed some java into that page.)
    The second part which I am really stuck on says:
    Create the coffee_processing.jsp that queries coffees and suppliers table (you created in homework 08) to display the following page:
    This part is where it queries the mysql database that I did. The page is basically supposed to look like this (in a webpage format):
    Here is the information about your order:
    | Name | Supplier | Price |
    | Espresso | The High Ground| 9.99 |
    Number of Pounds: 5
    Total Price: $49.95
    (I really confused on what I need to do to create a jsp to do this. Thanks so much in advance!)

    well, first create a jsp page that defines how the page will look. Then make use of a <jsp:useBean..> in combination with <jsp:getProperty....>
    and <jsp:setProperty....> to access a bean that does the database fetching.

  • Need to talk through some basic Java principles

    I know this is asking a lot, but I need to talk to someone about Java basics. I have an interview coming up. I am studying, but really need to talk through some things with someone who is familiar with Java programming. My email address is [email protected] If someone could send me a telephone number and perhaps spend 30 minutes on the phone, I would be very greatful. Thanks!

    I don't know if there are any forums where they help you fake your way through interviews.

  • Help Making a SIMPLE JAVA GAME *TINY GLITCH*

    got a tinnnny glitch and ive tried everything to get it to work, but so far no luck.
    Heres what my program does:
    1. Aliens spawn at top left (top 4 rows) and move to the right and dissapear (DONE)
    2. Shooting rectangle at bottom middle (moves left and right) and shoots bullets (DONE)
    3. When bullets make contact with alien the alien dissapears (DONE)
    4. When you shoot 20 bullets game over (DONE)
    5. When all the aliens fly by the screen game over (DONE)
    GLITCH
    1. When an alien is killed any bullet that goes over the exact same spot of collision the bullet dissapears! +so does an alien going over same collision spot
    MISSING
    1. Score, every alien kill + 10 CANNOT get a working score funtion to +10 fo every alien successfully hit :(
    My SRC jus copy and paste and compile, any help appreciated
    http://www.geocities.com/porche_masi/Assignment3.txt
    //ignore spelling mistakes in comments and outputs lol
    ive spent way to many hours over these 2 stupid problems, hope new eyes can spot the problem

    I'm not going to look at your code, but it sounds like when you're killing things you're not removing them from your future calculations. So if an alien is killed, it should either be removed from the list of aliens, or a "dead" flag should be set on it which causes it to be ignored in future calculations.
    edit I did look at your code actually, and that is a really, really bad use of multithreading. You shouldn't just create a new thread every time a bullet is fired. You should maintain a list of bullets, have the main thread drive the UI, and have a secondary thread to update the game logic (recalculate collisions, etc).
    Edited by: endasil on Nov 21, 2007 3:16 PM

  • Some basic java Questions

    class overload
    void test (long a)
    System.out.print("\n\t\t Inside Integer..."+a);
    class usetest
    public static void main(String args[])
    overload ob=new overload();
    double i=88;
    int j=54;
    //ob.test(i); this do not work
    ob.test(j); // works
    The one that do not work when typecasted works why? When method having same parameter is not present what java compiler do?

    The compiler will automatically perform a "widening" cast for you, i.e.
    a cast from one type to another where no precision is lost. If you supply
    an int and a long is wanted, the int will be cast to a long type.
    Not so from double to long because that isn't a widening cast, it's a
    "narrowing" cast because bits might get lost after casting. You have
    to cast that double to a long explicitly, thereby telling the compiler that
    you know what you're doing.
    kind regards,
    Jos

  • Is the i7 13" Macbook Air capable of playing some basic games?

    I'm looking into possibly grabbing a 13" Macbook Air with the i7 1.7Ghz processort and was wondering if it's capable of playing some basic games that are out in the Mac App Store such as Angry Birds, N.O.V.A. 2, or even Grand Theft Auto: San Andreas? Also I tend to use Vuze and sometimes Handbrake, would the high end 13" Macbbok Air be capable of doing all this for me?

    Capable? Yes indeed it is. However, if the game or application is CPU or GPU intensive, then you can expect longer waits for completion of tasks. It's not so much noticeable on rudimentary games, but it really has an effect on detailed fluid motion in games that rely on such.
    Handbrake tasks will just take longer to complete, it won't stop it.
    I use my MBA's for medium intensity gaming without any complaints. But really, you should refer to the system requirements on each, on a case by case basis.

  • The making of an online game

    Hello all users of the sun forums.
    I've always been facinated of games and have been wrestling with the idea about learning enough to be able to make a simple online game.
    I got several questions, mainly to see if this is something realistic or if it's not doable as a lone wolf.
    Would java be the right programming language for a online game? (As it can be run on many different platforms, its a good candidate).
    - Any other languages that should be learned in addition to java?
    - Specific books that would benefit for the making of a online game?
    What database technology should I learn about that would be the most beneficial for a online game? (be it a small or a large game)
    I know very little about servers and networking, so some points about things to read up on would be nice.
    And something i've always wondered about - How powerful server do you need for a 100 player thirdperson strategy game?
    I know this might take me some years to learn, but its fun to have something to fill my sparetime with.
    And sorry for my bad english!

    Nheme wrote:
    Kayaman:
    Are there big differences between SQL databases command vise?Well. Not big differences, but significant differences. I wouldn't worry about those at the moment if I were you.
    Are there any database standards except SQL?Probably, but SQL is the one you'd be using.
    I've been looking through several job applications, but it's hard to put together a list of programming languages that would go along with Java. HTML, XHTML, PHP, CSS, JavaScript, .NET, C#, C++ etc..Well, HTML and CSS and such aren't really programming languages... I'd recommend that you concentrate on Java and then include other things as you go along (and realize that something might be useful to know).
    My way of attacking this would be to make a roadmap of what I'm going to learn and attack it step by step, but it's hard when I don't know what I should include. Please recommend books as I find it easier to read, than tutorials on the net.I'm sure your way sounds very good, but it's impossible to do it like that. You can't decide in advance all the things that you want and are going to learn and then just go on and do it. Learning is a continuous process. I have about 10 years of Java behind me and some dabbling in other programming languages, but I still keep learning things. And I bet most of the people here with 20+ years in the industry (look at the people with tens of thousands of posts) will say the same thing.
    I haven't read it myself, but Joshua Bloch's Effective Java has been recommended in several places. I hope you enjoy reading, because that's really the best way to learn and then keep up with the programming scene.

  • JAVA Game DEV

    Does anyone know of a site which will walk a total newbie through making a very simple game in Java. It doesn't matter how crappy the game is, just something to get the newbie started.
    The website is for me :)
    Thanks,
    Christopher Gillis

    I recomend books like "Black Art of Java Game Programming". Although it is old. It is still very relevant.
    The sites that I learnt from are:
    http://www.gamejug.org/tutorials/
    http://www.electricfunstuff.com/jgdc/tutorials/jgdc_tutorials.htm
    http://blazinggames.com/books/jgd/ch01/page02.html
    They are good sites for amatures.
    I also found insparation and some code at:
    http://www.javaonthebrain.com
    Hope that helps!!

  • OPEN SOURCE JAVA GAME

    Hi, my name is Dydra and I have been programming an MMORPG in java this last two years. I want to publish an open source Java game to start a new generation of cross platform games, but I can´t do it by myself xD. So I want to share what I have done so far with everyone interested in programming games so that everyone can help making this game.
    All the code is not mine: some parts are from the book Killer Programming Games. I adapted the 3D MMO engine of that book to an 2D engine and customized some things.
    If anyone can tell me how to make this an open project here at sun forums, please tell me xD.
    Here is a youtube link with the game working so far:
    http://www.youtube.com/watch?v=CvNtx_pibwM
    PM me or email me if interested: [email protected]

    Do you know the best part? It is almost finished. The things that need to be finished are:
    -Leveling up and stats (no big deal)
    -GUI (like menus and invetaries. no big deal too)
    -NPC (this may be the most complex part)
    - Shop and Players Party/Trade
    -Drops
    THE REST OF THE GAME IS DONE! I already did a map editor with custom map objects and will be used to place Non Agressive NPCs. I also made a custom set up of menues and skills. To have a skill or item into the game you just need to open your wordpad and write the img file and what the item does (damage, heal, equip, instant spell, etc).
    I need help to improve animation of the sprites, skills, improve the GUI ( I did it all myself but it's kinda crappy, you know) and the NPC. As I want it to be a PVP oriented game because there is no real RPG PVP oriented game. Most PVPs are MMOFPS like GunZ.
    I eben have the host for the server! jajajajaj
    Need your help guy!!!! Di you hear me!!!??? jajaja
    Thanks for responding, I hope you'll join my PvP cause xD

  • Rank in a java game

    Hi ppl,
    I'm newbie in this forum, I'm development a java game and now I would like to implements a rank for players.
    Basically, I have some players that play to the game and then (at game finish) game will write a .txt file with date, score and name player.
    How I can implements it?
    Thanks, regards.
    Michael.

    MichaelStu wrote:
    link is broken...The link works for me, but if for some reason it doesn't work for you, just google "java file IO". Read through the tutorial carefully. Ask a question when you get stuck, and make sure you post an [SSCCE |http://sscce.org] demonstrating the problem.
    then need help in how implements...such as write in a txt file and then apply a bubble sort algorithm?What? You are thinking about it all wrong. Why would you write to a file and then sort?
    One thing at a time. Split your problem up into smaller pieces. Sorting your data is a completely different issue than writing to a file, and for that I'd recommend googling comparators and looking up the sort functions of the Collections and Arrays classes in the API (since links don't work for you, go ahead and google those too).

  • Java game AI

    Hi there, I am currently creating a battleship game which allows you to play against a computer or a human or run the game as a spectator watching the computer battle its own AI. I am having trouble finding an efficient way to program the AI when I hit a ship on the opponents map.
    Current logic: I hit an enemy ship and add all the possible directions into a queue and resolve them in order, up down left right. If there is an 'o' (miss) or 'x' (hit), currently in one of the suggested directions, it will be removed (since it has already been searched) and move on to the next coordinate.
    Problem: The AI is extensive in it's checking. It finds a long ship, 10 char long, and checkes all around the the ship making sure nothing else is there. Although this method is very accurate, it takes too many turns to verify that it has found the whole ship, therefore losing almost all the time.
    Any ideas?
    -Thanks in advance
    EDIT: Sample from AI vs AI.
    x = hit
    o = miss
    Computer2's Map
    0123456789
    0 .......xxo
    1 .ooo..o.o.
    2 ....o.....
    3 ..........
    4 .....ooooo
    5 ...ooooxxo
    6 .ooxxxxxo.
    7 .oooooooo.
    8 .......o..
    9 .o........
    Edited by: Krytical on Jul 15, 2009 2:55 PM

    I think you are not putting enough into it.
    AI is hard, no matter how simple the game may seem. I have written about 16 games (I might have missed one or two in a hasty count) and worked on a couple open source game projects. Of those 16, 2 of them include an option to play against the computer, i.e. they have a good enough AI. The rest are all strictly multiplayer or single player with no opponents (simulations). Of those two, both are also and where first multiplayer games. That is because until I can play a game enough to fully understand it strategically (even though I wrote it), it is impossible to write a working AI.
    So here is my advice, play a few dozen games against other players, the more different people you play against the better. Jot down your strategies in every situation, and ask you opponent if they would be kind enough to do likewise (it helps to tell them it is for writing an AI, otherwise they think you are just trying to learn their secrets for the next time you play). Then try out some of the strategies you get from others and see if you understand it, when it is best to use that strategy, and how well it works.
    At this point, you should try to code several of those strategies and see how well the computer does with it. Then code a way for the computer to weigh the possible effectives of the different strategies and randomly choose between them based on the weighted scale. As in, if start A is 5 times more likely to succeed than strat B in situation X then the computer should have 5 times more likelihood of choosing strat A over strat B for situation X.
    As a starting point, here is my strat for battleship in a way that should help with how to code it. I always look at which direction has the longest distance to where I have previously fired. But I also limit it to 4 spaces as that is the length of the longest ship (plus the one hit). So if I choose say F6 (isn't it letters across the top?) and get a hit, then I look around F6. Looking down I have already gotten a miss on F9 leaving 2 blank spaces. Looking left I have recorded a miss on A6, leaving 4 spaces that way. Looking up I have a miss on F5, so there is definately not one that way and this makes it less likely the boat runs north and south (up and down). To the right the nearest shot was a hit on a boat I already sunk but it is 7 spaces away, so I exceed the limit and reduce it to 4 spaces. So what do we have, 2 spaces down, no spaces up and 4 spaces to both the left and the right. At this point I am just going to randomly choose to go left or right and keep going that way until I get a miss or my opponent announces I sunk a ship, if a miss with no sinking I go the other way until said declaration. Should I get a miss on both sides without an additional hit then I will re-evaluate and since the only way left to go in that case would be down, that is how I would go. If I got a hit going either way but missed on both sides then I know I have two ships and I simply put the new hit on the back burner until I have sunk the first.
    Now this should all be relatively easy to code and should make the AI much more formidable. But there is actually far more I do when playing that game. For example, if the 5 length ship has already been sunk and the longest left is 4 length, then I only go 3 blank spaces each way in weighing my options. Similarly if the 2 length ship and both 3 length ships are sunk then I first check to ensure there is a total of at least 4 spaces along either axes (there must be on at least one of them). This will be a little more coding work, but will make the computer AI even more robust and formidable.
    If I was playing against your AI I would always place my ships from left to right, because I know the AI is then always going to waste at least 2 shots whenever it gets a hit. In AI the more unpredictable the AI is the better, this is why it is important to keep things random, and give the computer as many strategy choices as possible to weigh and then semi-randomly choose from.
    Also, this is the wrong place on these forums for this question, there is actually a java games section here, I think it is under other. Also there is actually a fairly active java game forum, but I don't recall the url for it atm. You will have far better chances of getting a response in one of those more appropriate places.
    JSG

  • 4 basic java questions..

    ok so I already learned Java last year (in grade 11), but my teacher didn't really teach anything, we learnt everything by ourselves from the API... so theres a lot of things I actually don't understand, but for now I want to ask 4 basic questions:
    1. What does static mean?
    2. Why would u "final" a constant variable? ie. If you have a variable called SIZE which is set to 5, so if u want it to be a constant, just never change its value. But what does the keyword final do to it?
    3. What's super? I see it sometimes, and my teacher showed us in the applet exampls to use super.paint(g) or somethign like that for the paint method, but I never use that because I noticed it works fine without it..
    4. Whats a question mark? I saw a game that was made in java and it had a lot of places where it had a question mark , which was part of the syntax. For example,
    int j1 = i != 0 ? i - 1 : 199;
    OR
    JUMPVEL = (fSuperSlime) ? 65 : 31;
    I really don't understand these lines...
    feel free to answer any of these questions...

    wow cool...thanks.. that question mark thing is nice
    saves a few lines..
    now, about super, so u mean u can access the parent
    class's variables?Variables, methods, constructors, if the access level is such that it's allowed.
    This will be covered in any tutorial or text though.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • How to make "Levels" in simple java game

    I just wanted to know if anybody knew how to make "Levels" in a java game. In my case, it is to change two polygons that are used in the background. I think you have to use an array of some kind, but i dont really know.
    Here is my source, the polygons are by the massive ///////// areas.
    I cut out the majority of the program, because it was too long.
    public class collision extends Applet implements MouseListener,MouseMotionListener
        private  Image rickImage,mazeImage;
       Image Buffer;
       Graphics gBuffer;
       int x, y;
       int[] LeftWallX = {0,204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,0};
       int[] LeftWallY = {500,499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1};
       //int[] PlayAreaX = {204,204,149,149,162,162,243,260,235,259,232,260,230,207,207,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
      // int[] PlayAreaY = {499,402,402,341,324,227,191,157,141,135,123,116,109,86,1,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       int[] RightWallX = {500,500,263,263,245,282,262,274,257,273,250,184,184,170,170,208,216,216};
       int[] RightWallY = {500,0,1,86,103,115,129,138,147,155,201,230,323,340,384,384,402,499};
       boolean mouseInside, collide;
       boolean rolled = false;
       boolean msg = true;
       int sX=204,sY=490,sW=12,sH=9;
       //Declare the rectangles
       Rectangle  movingRect,finshBloc,startBloc,oopsBloc;
       //Declare the polygons
       Polygon leftWall,playerArea,rightWall;
            ///Initiate
            public void init()
                 rickImage = getImage(getDocumentBase(), "rick.jpg");
                 mazeImage = getImage(getDocumentBase(), "maze1.jpg");
                 collide=false;
                 Buffer=createImage(getSize().width,getSize().height);
                 gBuffer=Buffer.getGraphics();
                 rightWall=new Polygon(RightWallX,RightWallY,18);
                 playerArea= new Polygon(PlayAreaX,PlayAreaY,31);
                 leftWall= new Polygon(LeftWallX,LeftWallY,17);
            public void paint(Graphics g)
                 drawStuff();
                 g.drawImage (Buffer,0,0, this);
    */

    I'm not exactly sure in your case what you are trying to accomplish. If all you want to do is make new polygons for your levels then you will simply need a Vector of type level (or polygon). Store multiple levels/polygons in that vector. This can be done many ways, probably the most efficient way would be to create a class Level of sorts and create each level object from there. This way you have all your levels stored into that vector.
    I have made programs where the levels/mazes are randomly generated based on certain parameters (this way you would not need to define any specific level). This can be done inside the Level class and added to the vector so that when a level is randomly generated there are literally infinite possibilities. I would suggest posting all your code or at least a breakdown UML diagram of what is going on in your entire program.

  • The ever so savvy "creating a java game" post

    Hey, I'm creating a java game, and I did research, and found that this question has been asked many, many times. But my question unfortunately did not match up with any of these posts :( So here goes...
    Im creating a java game, which will run as....kind of a mix between a 2d game, and 3d game (no i am not insane). I dont want the original zelda look, and i dont want the first person shooter look, I want my character to be viewed from an angle, like tibia - if anyone has ever played that. And I also want to leave open the door to changing the view within the game. I figured I can just get my graphics friends to draw things in 3-d, (draw a house [draw the 4 sides and the roof]), and then somehow skew these images to accomodate for a different view.
    I am more than willing to code some kind of graphics engine if what I need is not available, I have looked at a couple and found no such luck.
    So what is the most efficient way to create this game? By just sortof getting all the graphics to be from a certain percpective, and then somehow modifying them with java.....
    or by using some kind of graphics engine that allows me to change views? If so any recomendations?
    Thanks a lot - wow this was long, oh yea a couple Dukes for this too thanks again
    -Mark

    you don't need to do any skewing. Here's what I'd do. I'd store all the tile information in a matrix (Object[][]) with a custom tile class that has the information it needs to retrieve its appropriate image, and certain game related data like slow down factor when a person walks over a certain type of tile, and whether it can be collided with. I'd draw them based on however you decide to angle your tiles. But the important part is you go in this order:
    [0, 0], [0, 1], [1, 0], [0, 2], [1, 1], [2, 0], etc., etc....
    The idea is if you're turning the floor 45 degrees clockwise, to give the correct illusion of depth, you'll want to draw the furthest back tile first, and the furthest tile forward last. Whether you start on the left or right depends on what angle you decide to work with. At a 45 degree angle, it obviously doesn't matter whether you start on the left or right. But if you guess wrong with your rendering, it will show because tiles that are closer to the "camera" will be overlapped by tiles further from the "camera".
    for (int i = 0; i < tiles.length; i++) {
         for (int j = 0; j < tiles.length; j++) {
              graphics2D.drawImage(tiles[i].getImage(), i*horizontalSpacing - camera.getX(), j*verticalSpacing, camera.getY(), null);
    }horizontalSpacing and verticalSpacing will be determined by the angle of your tiles. Set those to match however you make your art.
    Drawing moving sprites will be a bit trickier because you'll have to decide which set of axes to follow... meaning, do you follow the axes of the screen, or the axes of your "rotated world." Give that some thought and once you understand what's happening with the perspective here you'll be able to see which is easiest.
    So there's your engine ;)
    Now, as for the art itself, make them in png format, so that you can have the base of your images be diamond shape, but of course tiles for players and walls and stuff will extend above that diamond. Just don't let them get below the base of their diamond otherwise the tile that gets drawn below them will cut them off. And you don't want a character's feet cut off by the "floor" as he runs ;)
    For your final question, don't let java skew the sprite. The only possible way to make it decent is if when you pick an angle, a 3D render takes your 3D world and it's 3D models and re-renders them at that angle; skewing is simply not capable of creating that illusion. The closest you could get is to simply squish the hight of your art to give the illusion that the camera is moving up, but since you can't expose things higher, like the top of your character's head (since the data doesn't exist in the "lower" version), it will be obviously funny looking.
    Hope that answers your questions, and good luck! I would definitely like to see what you come up with.

  • Moving from flash. whats a good starting point to making some mobile Edge apps?

    Hi.
    I'm coming from a strong Adobe background. I have used flash since the old macromedia days.
    I am looking to start making some mobile apps and I'm unsure where to start.
    I have brought myself up to speed with Edge and its pretty good.
    I want to put something together that has touch screen controls. basically I want to make a couple of buttons that the user can press on their phone, and the buttons trigger a movie clip to play from points on its timeline.
    There's so many Adobe products that are out and not out and for mobile and this and that.
    Is there a product that I should be using for putting mobile apps like this together? Is Edge what I'm to be using?
    I am a new creative cloud member although I am somewhat confused by its offerings, and remain unimpressed with it.
    thanks,
    John

    I think you need search with key "flash for mobile" and read carefull. I hope you will get some good things that you need. Thanks a lot.
    Member of @ du học Nhật Bản

Maybe you are looking for

  • How do i get all my songs back after itunes gets unistalled?

    I just recently unistalled Windows (iTunes and everything else got deleted) due to my computer issues. I have reinstalled it now but my library is cleared of songs.Is there any way that I can get the songs that are on my iPod back onto iTunes? Thanks

  • Apps not migrated from iPad 2 to new iPad

    I just got the new iPad. I am using an iPad 2 already. How do I migrate my apps and data from the iPad 2 to the new iPad? Here's what I tried last night and the results: 1) Connect the iPad 2 to my MacBook Pro. 2) Wait for complete sync and backup to

  • Different layouts for different pages

    hi all, i have created a form in which there are 5 output pages but the print preview shows only the first page out of 5.i want to go to the next page.plz help how would i do that.and  i want different layouts for different pages. thnks n regards, mu

  • Query to get Vendor Name who is Customer also

    Hi, Can any one send me the query to find the Supplier/Vendor who is Customer also and vice versa. I am in 10g. Please suggest me some query to find out dis. This is very imp for me. Thanks

  • Default Clients in R/3 4.7E, ECC5.0 and ECC6.0

    What are the Default Client in R/3 4.7E, ECC5.0 and ECC6.0? ECC stands for what? am little bit confused! some r saying three (000,001& 066) n some r saying two (000 & 066). Pl correct me.