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.

Similar Messages

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

  • 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

  • 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

  • Side Scrolling in Java

    Hi ... I would like to know how to do side scrolling in java... then same concept of how MapleStory did it. I have tried with Graphics and other awt packages but it dont seem to work out...
    Can someone give me a head start or if possible the full implementation.. :P

    I found this on http://www.apartmenttherapy.com/do-scroll-bars-still-matter-151901 and it worked for me.

  • AS3 Creating Side Scrolling Thumbnails?

    I'm creating a gallery page for my site, and I need a side
    scrolling thumbnail display.
    Basically it would have several thumbnails that would keep
    scrolling for ever (some how duplicating the content in a mask). If
    anyone has anything like this or any links that would be great.
    Cheers!
    Parallels.fm

    Six different examples here:
    http://robdillon.com/flash.html

Maybe you are looking for

  • Perifials will not work with Windows 7

    I have a new HP h8 1214 PC WiFi with Windows 7 installed.  My old HP ScanJet 4850 and my HP Personal Media Driove 1600 will not install. My previous operating system was XP.  I would like to install the ScanJet 4850 because it can send slides and fil

  • Placing a signature field in a PDF in Acrobat X

    In Acrobat 9 I could place a signature field into a pdf without converting the PDF into a form.  The procedure began with clicking on the Forms tab.  I could drag the signature field to a location and a user could click on the signature field and dig

  • Resolving color management with Epson printer

    Using an Espon Stylus Photo RX600 InDesignCS 3.0.1 PhotoShop 8.0 I continually struggle with color when printing scanned images or images off of a camera card into PhotoShop and/or InDesign, and with the warning messages (upon opening) for tagged or

  • Function keys to wd application

    Hi all, how can I get function keys (F1, F2, F3...) to web dynpro button elements?  I am doing application where user uses keyboard (or touch screen) and not mouse and they need to jump from one field to another without having to go through them all.

  • Update Aperture 2.01

    After dowloding Aperture 2.01 update, I launchthe dmg files, and it says : that a previous version 2.O needs to be installed before updating. But I have version 2.0 installed on my laptop. Hubert