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.

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 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

  • 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?

  • 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.

  • 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.

  • 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.

  • Magic mouse problem - side to side scrolling...

    Is anyone else having a problem with mouse partially working? I can scroll up and down, zoom in, and swipe with 2 fingers but can't scroll horizontally or 360. Also I can only use the scroll up and down feature with 1 finger if the web page has a side scroll bar. So for instance I can only use mouse in the traditional way on the imac front page or on a web page without a scroll bar. This is driving me nuts!
    I can't understand how it's half working. Do I need to send it back? On os 10.6.2 and showing up in pref box with all options ticked. Have only had imac a couple of weeks so any suggestions would be great - thanks.

    red72 wrote:
    […] can't scroll horizontally or 360.
    It seems obvious that you can't scroll horizontally unless the page you're visiting, or your document, is larger than the width of your window.

  • I have a new mac pro and can't get a side scroll bar.  What can I do to get this?

    I have a new mac pro and can't get a side scroll bar.  How can I get this?

    The scroll bar is now set to appear automatically when you start scrolling with a trackpad or scroll wheel mouse. If you are using an mouse without a scrolling device, you should change a setting.
    In System Preferences, click General, and in the Show Scroll Bars section, click the option for how you want it to work. If you want to see them all the time click "Always."

  • The side scroll bar is locked and I don't know what to do.  Also video does not work.  I only get sound.

    The side scroll bar is locked so I can't read anything on the web.  Also, I cannot get any video on YouTube, etc.  It is a black screen.

    See the troubleshooting for a white-screen included here:
    iPod touch: Hardware troubleshooting

  • Side-scrolling photo gallery on iweb????

    I have created a site on IWeb, and have several pictures on the site (www.sharonrai.com)
    and I would like to make a side-scroll on the side with all my pictures from each section on it, so you can view all the pictures in a glance on the side, and if you want to look at one, click on it, and it becomes big...
    Anyone know how to do this?
    Thank You.

    If you are publishing to .mac, create a new site in iWeb for each folder you would like password-protected and enable password protection for that site. Repeat the process however many times you need a new site (folder) with unique username and password. You have to do all of this manually however, the process is not dynamic where the user could register on your site and create their own username/pw and have their username be their folder location on your site. Can't do that with iWeb and/or .mac but you can do the manual creation in iWeb as mentioned.

  • How Can I Side Scroll in Folder Pane

    I have recently started using Lightroom again (has 2 then upgraded to 5 in the past year) one thing I've noticed is that there's no side scrolling in the Folders pane. Because of that I can't read the folder names.
    I know if I move my photos to a higher level directory that would fix it but it's not like my photos are in an unusual place. The path structure I use is:
    Mac HD : /Users/Terriann/Photos/2014/12-17 - Folder of images/
    I could of sworn the last time I seriously used Lightroom (years ago and on a PC, now I'm on a Mac) I could side scroll that panel so I could read the folder names.

    Although I agree that a "scroller" on the folder panel would be useful, Lightroom is designed to use a keywords, metadata and filters workflow for selectings photos instead of a folder based workflow and once you start using it that way you will not have to "drill" down through folders looking for files.
    For instance, to select dates for any given day or month you can use the filter bar
    or you can click on the little arrow next to the date in the metadata on a photo and it will filter for all the photos on that date.
    It is a different concept to folders but once you set it up it is very powerful.

  • Plzzzz solve my problem my side scroll bar does nt appear due to which i have to face the problem in scrolling page up and dowen quicly.

    i am using latest version of mozilla suddenly on mozilla searching page side scroll bar is not appearing due to which i have to face prob in scrolling the page which i see i am not understanding what has happened.plz solve this problem as soon as possible.

    Here you go.

  • Browser displays no slider bar to side-scroll if a page is oversized.

    I'm having a problem with the new Firefox 4 and how it displays websites that are oversized. This new browser has a lack of a side scroll bar at the bottom of the page (or top) that allows me to view the whole page.
    Also, I can't have my Fonts set at low 18 because my eyesight gets blurry quickly if it's that size. Anyone else have this problem and know how to remedy it? Thanks.

    It is possible that the screen is too high and that the status bar and scroll bar fall off at the bottom.<br />
    Open the system menu via Alt+Space and see if you can resize that window.<br />
    If that works then close Firefox to save that setting.<br />
    See also:
    * http://kb.mozillazine.org/Resizing_oversize_window
    You can use one of these extensions to adjust the default font size and page zoom on web pages:
    * Default FullZoom Level - https://addons.mozilla.org/firefox/addon/6965
    * NoSquint - https://addons.mozilla.org/firefox/addon/2592

  • 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

Maybe you are looking for

  • How can I get my old pictures onto my android?

    I was wondering how I can get my old pictures onto my android from my Verizon account?

  • The infamous problem of the Click Wheel getting frozen

    Since I've read a lot of stuff on the internet about this very common problem, and that nobody has found a solution, I wanted to start this topic in order to solve it through different experiences in the community. I live in Spain, but bought my iPod

  • Is it possible to remove the guts of a G4 AGP and put it in a G5 Case?

    I really like my G4 PowerMac, but I want to see if it is possible to put a G4 PowerMac AGP parts in a G5 Case. Is it possible? Thanks for any help. I am considering doing this.

  • E2000 NAT Problems for Multiple Xbox Consoles

    Hey there. My brothers and I recently all split the cost of a new E2000 Linksys router. I just got it home and set it up and it solved most of the issues we had been having with our Xbox's (kicking us offline, not allowing sign ins, etc.) which was w

  • Global Default Font for Application

    Hi, I'm using flash builder 4.5 and I would like to set a custom font as the default font for the entire application. I've tried setting fontFamily="myCustomEmbeddedFont" in the main application with no success. Is there a spot that I can declare a c