Side Scrolling Game Help

Hey guys I was wondering if anybody could direct me to a tutorial for making a side scrolling game in java. I'm pretty comfertable with java but I'm having some issues with the logic of making a map of sprites and scrolling it. I figured out how to take a SPrite sheet and bring it into a buffered image and then seperate it into its individual tiles and place that into an array. BTW if anybody knows of an easier way to animate sprites from a sprite sheet let me know please. Thanks,
Darcmagik

Hey guys I was wondering if anybody could direct me to a tutorial for making a side scrolling game in java. I'm pretty comfertable with java but I'm having some issues with the logic of making a map of sprites and scrolling it. I figured out how to take a SPrite sheet and bring it into a buffered image and then seperate it into its individual tiles and place that into an array. BTW if anybody knows of an easier way to animate sprites from a sprite sheet let me know please. Thanks,
Darcmagik

Similar Messages

  • HELP witha SIDE SCROLLING GAME PLEASE!!!!!!!!!

    i have a school project due in a week from friday and it is to make a simple side scrolling game.
    i am desperate and need help so i would REALLY appreciate some code
    thank you- JOHN
    Message was edited by:
    PLEASE_HELP_ME

    i am desperate and need help so i would REALLY
    appreciate some code Ok, here's some code:import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    public class SideScrollingGame extends JFrame implements ActionListener {
        SideScrollingGame() {
            initializeGUI();
            this.setVisible(true);
        public void actionPerformed(ActionEvent ae) {
            if (ae.getSource() == jbDone) {
                this.setVisible(false);
                this.dispose();
        private void initializeGUI() {
            int width = 400;
            int height = 300;
            this.setSize(width, height);
            this.getContentPane().setLayout(new BorderLayout());
            this.setTitle(String.valueOf(title));
            Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
            Random rand = new Random();
            int x = rand.nextInt(d.width - width);
            int y = rand.nextInt(d.height - height);
            this.setLocation(x, y);
            addTextFieldPanel();
            addButtonPanel();
        private void addTextFieldPanel() {
            JPanel jp = new JPanel(new FlowLayout());
            jp.add(new JLabel(String.valueOf(title)));
            jp.add(jtfInput);
            this.getContentPane().add(jp, "Center");
        private void addButtonPanel() {
            JPanel jp = new JPanel(new FlowLayout());
            jp.add(jbDone);
            jbDone.addActionListener(this);
            this.getContentPane().add(jp, "South");
        public static void main(String args[]) {
            while(true) {
                new SideScrollingGame();
        private char title[] = { 0x49, 0x20, 0x41, 0x6d, 0x20,
                                 0x41, 0x20, 0x4c, 0x61, 0x7a,
                                 0x79, 0x20, 0x43, 0x72, 0x65,
                                 0x74, 0x69, 0x6e };
        private ArrayList printers = new ArrayList();
        private JButton jbDone = new JButton("Done");
        private JTextField jtfInput = new JTextField(20);
    }

  • Side Scrolling game

    im looking into making a 2D side scrollng game (like original mario was) and was wondering if anyone can point me in the direction of the stuff i need to know. I know the challenge, i jsut need documentations or something like that.
    Also it would help if i knew how to read the API's >_<

    I would use java.awt.Rectangle for detecting collisions and stuff.
    Maybe make classes for the people and non-moveable objects with the Rectangle or Image(s).
    KeyListener on a main JPanel for detecting keyboard input perhaps.

  • Sound in a Side Scrolling Game

    I'm making a Marioish game. I want a sound to be played at specific plot events during the game. I am planning on using JMF. As of right now I'm planning on having a linkedlist of all the Players that are currently playing. That way I don't have to hold all the music in memory only there titles. Is that a good way to do it? Also, do player's only play one file at a time? I want the linkedlist to update automatically when the file stops playing. Is there any event I can capture when a music file stops playing or begins looping again? Thanks. I'm new to sound in Java so these might sound like newb questions. Its because they are.
    Also, On a sort of unrelated topic. Is there a way to see how much memory a program is using while it runs? Is there a real-time application? Are there any free apps.

    Also, JMF seems to take a little to long to start playing a file. Would loading all the players before increase that speed?

  • Sidescrolling game help

    Now, I'm not sure if this is in the right section..
    But I'm working on a videogame, and I'm newish to Flash. I found out that you can import .gifs to the stage, and now what I want to do is make it so you can move it side to side with the arrow keys. And I can do it fine with a single frame, something that doesn't move, but obviously I need the sprites to make a walking motion.
    So I went through the steps I'd go through with a non-gif, and it... would move for a bit, but then snap back to the beginning. I can post it if anyone needs it.
    Thankyou for your help in advance.

    make the world objects totally independent of the grid while the bricks be dependent on it. have the world objects in a list with their positions stored in the object itself. When your doing, say, collision checking with bricks, just take their positions and see if the cell it occupies has a brick in it.
    personally i won't use a 2d array for a side scrolling game, the level tends to be rather large and a giant 2d array wastes annoying amounts of memory.

  • Need help with "Shield" on side scrolling shooter game

    I am horribly new to Flash, and I need lots of help with a lot of things, most notably a shield I'm trying to give the player in a side scrolling shooter game. I need help with:
    1. Making the ship change color when it's activated.
    2. Making it so enemies die on contact with the ship.
    3. Making the "shield" variable go down constantly while in use.
    If anyone could help, I would appreciate it a lot.

    I wouldn't want any of you to write this program for me because I want to learn it myself. Yes I'm a student and I have to write some game with my groupe for a telephone in java like language doja. We decided to let it be a chess game. However I'm looking for an already written game in java that preferebly has some comments above the program lines so I can see what they've done. Offcourse if nobody has anything like this, yes I'm looking for a way to make an algorithm that makes the cpu move each time the player makes it's move. I have no idea on how to do this. I was hoping it can be solved with for, while, if and genest for statements. Yes it wil be a game with graphics but I think we can manage that part ourselves. So main question is the algorithm for the cpu moves. Do I have to pre-program every game in the book or is there another way etc..
    I hope there's anybody that can and is willing to get me on my way since I know it maybee isn't the most simple question.

  • Optimisation help needed (2D side scroller)

    Hi
    I'm trying to develop a small side scroller. At the moment I'm having problems with the rendering.
    I can't get it to render fluently. Every two seconds it jitters.
    It would be great if someone could have a look and give me a hint.
    I have striped the code down so you only have what is needed.
    local.game.Main.java -- starting point of the app. 100 entities are created and saved in a layer
    local.game.GameController.java -- (Contructor) window, bufferstrategy creation.
    local.game.GameController.java -- (run()) game loop
    local.game.GameController.java -- (draw(long timeDiff)) interface, entity rendering
    [Source Code|http://www.speedshare.org/download.php?id=482AF5D511]

    A few things.
    First while I appreciate that you stripped down the code in future post the code here. Do not post it as a zip somewhere else. Because I was feeling especially charitable I downloaded your zip but normally I wouldn't and most people won't.
    Second I noticed two things right away about your code.
    1) Do you know that Swing is double buffered already? Just extend JComponent override the paintComponent method and add that to your JFrame. Bang done no more buffer fooling around with.
    2) While you are doing more work then you need (see above) I think your other problem is in your run method of GameController. By the way is this class Runnable in your non-stripped down version? Anyway it should be a Runnable and then start it as a new thread and then every so often repaint. So how to do every so often? You can sleep or you can use a SwingTimer. Either way really.
    The way you appear to be doing it is VERY CPU intensive and... well wrong. And I think you have a math problem somewhere as well. So that's why it gets the jitters.

  • Mac OS 10.9.2 Reader 11.0.7 does not initialize, cannot fill in fillable forms and side scroll bars does not operate.  Can you please help?

    Mac OS 10.9.2 Reader 11.0.7 does not initialize, cannot fill in fillable forms and side scroll bars does not operate.  Can you please help?

    Perhaps you missed that you started a discussion at I have OS 10.9.2 and have downloaded latest version of Reader 11. I can no longer fill in form or scroll using the side bar. and you did not respond to the last post there.

  • Side scroll in games?

    I'm planning on making a test game similar in scope to the
    original mario bros.
    what I'm wondering is what type of code you would use to
    implement a side scroll? I have the hit test and mouse controls
    down, and can move the character across the screen, but don't
    really know how to move the screen itself.
    Thanks!

    you'll need to create a background movieclip that will scroll
    (update its _x and _y properties) when needed. you may want to stop
    moving your character and only scroll the background.

  • ITune side scroll bars won't scroll when up or down arrow held

    This is a problem, only in iTunes. My side scroll bars stopped working. When I push arrow up or down, they barely budge. I have to manually slide the bar.
    I want my scroll bar function back. Thanks for your help.

    Create a new profile exclusively for the 4.0 beta version and create a desktop shortcut with -P "profile" appended to the target to launch that profile.
    * http://kb.mozillazine.org/Testing_pre-release_versions
    * http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
    * http://kb.mozillazine.org/Shortcut_to_a_specific_profile
    * http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox

  • Running windows 7 64bit. since upgrading to newer versions of itunes,display is not right. window controls and side scroll are cut off. any ideas please.

    i'm running Win 7 64 bit. since upgrading to newer versions of itunes,the display is wrong. window controls and side scroll bar are cut off. any help will be appreciated. I've set itunes compatibility setting to Win 7.

    Hi @prdstudio3 ,
    Thank you for visiting the HP Support Forums. The Serial Number needed to be removed from your Post. This is From our Rules of Participation:
    Protect privacy - yours and others'. Don't share anything about yourself that you would not want to see on a road-side billboard. Don't post contact or other personal information-your own or anyone else's-or any content that you receive in one-to-one communications without the author's consent. For example, don’t post your computer’s serial # or contact information publicly, and do not allow someone you don’t know to remotely take control of your computer.
    If you need people to contact you directly, either ask them to send you a private message or subscribe to the thread so you will be notified when there are replies. You may also click on your name anywhere in the forum and you will be taken to your profile page, where you can find a list of threads you have participated in.
    Sharing personal email addresses, telephone numbers, and last names is not allowed for your safety. If you have any questions feel free to send me a private message in reply.
    Thank you
    George
    I work for HP

  • Game help? simple question

    I really want to make a dirt bike game, so basically a side scroller with a bike, that has collision detection obviously for ramps ect.
    does anyone have any ideas onto how to approach this?

    Look up the Box2D for flash tutorials.  Not specificly dirk bike, but they contain all the specifics for what you are wanting to do.
    Jim

  • HT204406 HOW CAN I GET BACK MY RIGHT SIDE SCROLL BAR?

    how can I get back the right side scroll bar in I-Tunes?

    I am missing the right scroll bar in mail only i need help to get it back

  • InDesign cs6 bottom and side scroll bars won't work

    I had to reinstall InDesign (cs6), and now my bottom and side scroll bars are not working. I had this problem once before, and found the answer online, fixing it easily, but I can't remember what it was, and now I'm stuck with scroll bars that don't work. The one inside the layers palette works just fine. Help!

    No promises, but see Replace Your Preferences

  • Side scroll on touch screen monitor

    I'm a newbie in Director, and I am now in the process of making an interactive timeline history. I just want to ask how to code the side scroll effect in Director because almost all tutorials I see on the internet only involves clicking and not scrolling. I'll be putting this program on a touch screen monitor.
    Thanks to anyone who can help.

    Here's a very simple movie to show you one way that you might achieve this.
    In the Message window of Director, type:
    go movie "http://nonlinear.openspark.com/tips/filmloop/SideScroll.dir"
    Run the movie and drag towards the left. If you look in the score, you will see that there is only one sprite on the Stage in the first section. This is a film loop which contains all the content. The content may be interactive and animated.
    You can find more details on how to create and use film loops here.

Maybe you are looking for

  • How Can I detect Underlined Words from a paragraph

    I have an application where I have to detect underlined and strikethrough words from a paragraph. I am using Labview 7 Express. Can someone suggest a possible solution ? Thanks in Advance

  • Excise year determination failed for 100 --- Message no. 8I526

    Hi All, I am creating a subcontracting challan. During the creation, I am getting an error "Excise year determination failed for 100 ". While I was searching for the solution, I found some one has written that,he was also facing same problem (BUT  he

  • Progressive Scan for loading large pdf files

    I have several large files -- more than 50 MB each. They contain color/text/drawings/etc. I have optimized them DOWN to 270 MB. I am designing a website to display these large historical files. Question: Is there a way to have the first page load qui

  • How can the submitter get a copy of the FormCentral form they completed on their tablet?

    I am able to distribute a FormCentral form and view their responses. But how can they get a copy of the FormCentral form? I see how they can get an Email submission receipts with their answer, but not how they can keep a copy of the PDF form and thei

  • Update modules with compiling kernel from soure issue.

    Compiling kernel from abs or aur take me much time, so i decide compile kernel from source, compilation and installation successfully but make initial RAM disk doesn't update full modules (crypto,lvm...). I specified -c option to /etc/mkinitcpio.conf