Game Map Making

I got a problem, not too sure how to go about doing this coding wise.
What i do is load in an image (a strip of multiple images), make it a bufferedImage, Then i paint my Canvas by doing a dbl for loop, getting the subimage, and painting that.
So now, my canvas is composed of a bunch of subimages, that are all bufferedImages.
What i want to do is somehow make one BufferedImage from all the subimages, then just paint that WHOLE larger image onto my canvas. That way, when movement takes place, all i have to do is translate the larger image to make it look like a person is moving.
Currently, my code doesn't do that. It just paints a bunch of little images. How would i create a larger Image, from a bunch of little ones?

Thanks for the tip JBanes. i'll look into it.
Particle, im hoping my maps aren't going to be that
big. Im not creating a huge map. I know there are
other methods, like page flipping, but those seemed
too complicated for what I wanted to do.
If it does turn out that it runs outa memory, i'll
have to try a different method.
thanks.how big is not big?
also, if you want your image to be cached in vram (i.e. an automatic image) it cannot be bigger than the screen size. (an undocumented limitation of Volatile/automatic images)

Similar Messages

  • Color adjustment on strategy game map

    I made a strategy game, showing a map with armies on it. The map is a pretty large image over which the user can scroll.
    My problem: I want to draw the provinces of the different factions in different colors.
    First of all, is this right?
    1. Most phones do support color changing in pallett nowadays.
    2. Most phones do support transparent png's nowadays.
    My question:
    - Is there a way to color the provinces? I can make an extra image for every province, with one transparent color, do a color replace and place the partly transparent image over de province in my map. But this uses so much of my processor speed and memory, I'm sure it cannot be done. Does anyone know a better way? A totally different solution maybe?
    Right now I'm drawing tiny flags on the provinces, but they're not very clear.

    I made a strategy game, showing a map with armies on it. The map is a pretty large image over which the user can scroll.
    My problem: I want to draw the provinces of the different factions in different colors.
    First of all, is this right?
    1. Most phones do support color changing in pallett nowadays.
    2. Most phones do support transparent png's nowadays.
    My question:
    - Is there a way to color the provinces? I can make an extra image for every province, with one transparent color, do a color replace and place the partly transparent image over de province in my map. But this uses so much of my processor speed and memory, I'm sure it cannot be done. Does anyone know a better way? A totally different solution maybe?
    Right now I'm drawing tiny flags on the provinces, but they're not very clear.

  • Need some help on a game im making

    Making a game called Beetle however i got stuck when trying to display the players name in the main method. As you will see the variable playerName is supposed to be returned by beetleGameIntro method but i dont think it is because when i run it the dialog box is blank...also i played with the initializing of that variable and found out that if i take away the blank quotes and make it public static the dailog box shows "null" but i want to know why its not displaying the name entered.
    public static void main(String[] args)
            boolean playAgain=false;
            boolean hasHead=false;
            boolean hasBody=false;
            boolean hasTail=false;
            boolean hasFeelers=false;
            boolean hasEyes=false;
            boolean hasLegs=false;
            int feelerCount=0;
            int eyeCount=0;
            int legCount=0;
            String playerName="";
            beetleGameIntro(playerName);
            JOptionPane.showMessageDialog(null, playerName);
            while(playAgain=true)
            System.exit(0);
        } // end main
    public static String beetleGameIntro(String playerName)
            boolean seeRules;
            playerName=JOptionPane.showInputDialog("Welcome to the Beetle Game! "+
                                                   "\n \n What is your name? ");
            seeRules=yes("HELLO "+playerName+".\n\n Would you like to see the rules (Y/N)?");
            if(seeRules)
                displayRules();
            return playerName;
        } // end method beetleGameIntro

    When you call the method beetleGameIntro from your main method, what happens is that the contents of playerInfo in the main method (" ") is copied to the variable playerInfo in the scope of the beetleGameIntro. The variable in the beetleGameIntro is not the same as the variable in the main method. The following code does exactly what your code does right now, and might clear things up, but not fix your problem. You should try to fix it yourself so that you won't run into the same problem again :)
    public static void main(String[] args)
            boolean playAgain=false;
            boolean hasHead=false;
            boolean hasBody=false;
            boolean hasTail=false;
            boolean hasFeelers=false;
            boolean hasEyes=false;
            boolean hasLegs=false;
            int feelerCount=0;
            int eyeCount=0;
            int legCount=0;
            String playerName="";
            beetleGameIntro(playerName);
            JOptionPane.showMessageDialog(null, playerName);
            while(playAgain=true)
            System.exit(0);
        } // end main
    public static String beetleGameIntro(String unusedVariable)
            boolean seeRules;
            String playerName=JOptionPane.showInputDialog("Welcome to the Beetle Game! "+
                                                   "\n \n What is your name? ");
            seeRules=yes("HELLO "+playerName+".\n\n Would you like to see the rules (Y/N)?");
            if(seeRules)
                displayRules();
            return playerName;
        } // end method beetleGameIntroI think you don't even want to pass a variable to the beetleGameInfo method, only store the result of the call in a variable in the scope of the main method:
    String playername = beetleGameIntro(); // this goes in the main method

  • Why is Apple Maps making up words?

    The voice of navigation (siri) apparently made up a word the other day. I was driving down a road using navigation on my phone, which was plugged into my car speakers.  Siri told me to turn off on to a ramp and I did so, Then it it gave me the next direction: "In 900 feet turn right on to 'adweandi'." Adweandi is not a street anywhere that I know of, and definitely not in that area (I am pretty familiar with the area), so I looked at the screen and it said "Turn right onto Broadway".  I thought maybe I missheard what it said, so I had it repeat the audio direction, and again it said "Turn right onto Adweandi".  I had it list all of the steps and there was nothing in any of the directions that looked even remotely similar to 'Adweandi'.  I'm not even sure what exactly it was saying, but it sounded like the words 'add' + 'we' + 'and' + 'I' strung together with no spaces. I had it repeat the word like 10 times, and it just kept saying it over and over.  When I finally made the turn on to Broadway like it said on the screen, it immediately said "Continue on Broadway for 2.5 miles and the destination is on your right."
    What could cause something like this? Has anyone else experienced the voice navigation making up words before? I know sometimes it can mispronounce words, but first of all Broadway sounds nothing like Adweandi, and second it said Broadway perfectly clearly after I made the turn.
    I am using a 16GB iPhone 5s running iOS 8.1.

    This obviously isn't a big deal, I'm just curious.  This is where I was, you can see there isn't anything like adweandi here:
    https://www.google.com/maps/place/671+N+Speer+Blvd,+Denver,+CO+80203/@39.7269043 ,-104.98802,19z/data=!3m1!4b1!4m2!3m1!1s0x876c7f27c7f4b551:0x2d08094875d3fc5b

  • Creating simple game map

    Hi,
    I would like to know that what can be used to create a simple game.. VERY SIMPLE game.. not 3D or Java 2D api used i guess..
    game
    A board with lots of circles (which user can draw) representing territories and links (editable) between the territories representing paths between territories ...
    I jsut need to know what can be used to represent a territory? a JLabel? a JPanel?
    The state of these objects(territories ) will change over time and so does the links i.e. the paths between the territories.
    I just need to draw the map.
    Any help will be appreciated.
    Thank,

    If you are writing an app with that sort of GUI you are going to have to bite the bullet and learn the 2D graphics API: http://java.sun.com/docs/books/tutorial/2d/index.html

  • Large Scale Game Maps In WPF

    I attempted to create a map in WinForms, where my window centered on a small portion of a much larger map my character would walk through.
    However, according to research, I wonder if WinForms is the way to go.  I have read suggestions to create as many as 900 Picture Boxes (as tiles) for my map, then creating some sort of zoom effect to have my window only show, say, 20x40 while my character
    explored dungeons, etc.
    Maybe this IS the way to go?..... as stated in those tutorials, it required a percentage of a percentage of memory, which is what I am going for.
    I opened a project in WPF, which appears to have some more flexibility.  There is a Main Window, then a Grid... could I make the whole map in the grid then have my Main Window as my focal point while, say, I code the Grid to shift as I move, or vice
    versa?

    I have extensive experience with wpf but I do line of business applications.
    I think you'll find wpf is significantly slower when manipulating large amounts of graphics.
    On the other hand, you can do whizzy stuff like animations and you can make the controls and stuff look fancy very easily.
    I've never done anything like you're describing but I've played plenty of games a bit like that.
    I'd be inclined to have a small map in a corner with an overview and a relatively small number of objects on screen as tiles. Maybe the central one and either one or two of the bordering layers.
    You can easily scale stuff but I'd consider layers.
    Show a basic map until you're in the tile then overlay more detail on the one you enter.
    You can layer stuff in wpf easily and there's even this thing called an adorner layer which goes on top of everything else.
    You know VS is written in wpf?
    The drag and drop handles on controls in your designer are adorners.
    I'm not so sure about the zooming thing but yes you can do that.
    There's even a zoombox control
    https://wpftoolkit.codeplex.com/wikipage?title=Zoombox
    I wouldn't worry about memory so much.
    Focus on your design.
    Oh
    One thing is perhaps worth mentioning.
    A visual can only have one parent.
    http://social.technet.microsoft.com/wiki/contents/articles/29964.wpf-tips-only-one-parent.aspx
    Which means if you have an image which is used in two places you need to mark it:
    x:Shared="False"
    So it's a new copy each time, or copy it in code.
    Hope that helps.
    Technet articles: Uneventful MVVM
    All my Technet Articles

  • Reading int[] in the game map

    I have a method setGameMap() which has return type: int[] . It contains a set of tiled map stored in arrays. If i want to call this array in another class, how do I set the tiles one by one using for loop? ( e.g. castleMap[i] ) as i want to setCell using LayerManager.
    for (int i = 0; i < gs.getGameMap().length; i++) {
    int column = i % 30;
    int row = (i - column) / 30;
    castleLayer.setCell(column, row, ?????)
    It requires int instead of int[]. What should i put on the question marks?
    How to convert int[] to int?

    How to convert int[] to int?You can't just cast an array of values to a single value.
    What would be the integer value of this array: [1,2,3,4,5]?

  • Game programming: making a "ray"

    Hi!
    I am trying to make a simple game, using the Grahpics object and the drawLine method. I want to make a line, starting at the bottom, center of the window, and going to where the mosuse clicks (the pointer is a cross hair). It's easy to just draw a line, but I want this "ray" to grow gradually like an animation to where I click with the mouse.
    Anybody got any ideas?
    thnx!

    sorry, i guess this should be posted under games dev....

  • Game app making purchases a deletion

    I deleted a game three days ago and am now finding charges for in app purchases.  Any idea how to stop this?

    In Canada, you cannot buy apps with a gift card. You can buy music and movies.

  • Why can't I buy in app. I have brought both games and in app before. I have tried to by a full game but as of 24 hours ago I can not do any thing. My card details are correct I have money in my account. I have checked country and restrictions.

    I have never had a problem before.
    I have down loaded apps, games, I have upgraded from the free trial to full game by making a purchase.
    I have made in app purchases before.
    For just over 24 hours now I cannot connect to iTunes Store. Every time I try to purchase anything I just get an error message saying' cannot connect to iTunes store'
    I have checked my account details and my card details they are all still correct.
    I have tried making purchases via different makers, I.E big fish or different. It doesn't matter no matter what I try I cannot purchase anything.

    Cannot connect to iTune Store
    http://ipadinsight.com/ipad-tips-tricks/best-fixes-for-cannot-connect-to-itunes- store-errors/

  • How to encapsulate two games in a new flash document

    Hi mates!
    Now that I have my first two games I want to encapsulate them in a new document!
    Here is my idea:
    Create a new document with 4 keyframes in the main timeline.
    The first one will accommodate the title and two "play" buttons (each allowing to play a game).
    The second one will contain the first game.
    The third one will contain the second game.
    The last keyframe will contain the scores.
    Each game contains a movieclip that is being controlled by a main class that I wrote using as3.0. For example imagine that one of the games is a simple rectangle that the user moves with the arrow keys. The motion code is inside the main document class. The second game is something similar.
    So, how do I "import" the games (that were developed totally independent of each other ) to the keyframes of my new flash document?
    Could you help me?
    Thanks in advance

    Importing the swf's will destroy any actionscript they have.  You'll need to copy the timelines of the games into movieclips in your other file.
    You might instead consider just loading the games dynamically, making the main file more of a loading/summary platform that you use to communicate with the loaded games.  This approach would likely allow you to easily add even more games as long as you have a similar communication scheme established.

  • Raw material Moving Avg. Price (MAP) should include overhead cost.

    We receive a raw material that has unit price of USD 10, the material is used in BOM. We incur some additional cost on that material and want to include that additional cost as a part of raw material cost. Say additional cost is USD 1 per unit. We want the system to include USD 1 in material MAP making is USD 11 per unit (i.e. 10 + 1).
    Please help how can we achieve this.
    regards
    Chris

    Hi
    Your scenario would be better represented by Price Control S and using BOM/Routing/Prod order in PP... I dont know why your PP guys should be against it.... You should do it if you wanna capture the Loss of 13 kg in the system
    Anotjer option is to create a condition type and assign an accrual key to the cond type so that the Offset for this cond type does not post to GR/IR account.. Else, your vendor would get paid extra
    Refer this thread for more details
    Raw Material costing and update to inventory valuation
    PS: Note that raw mat cost estimate woyuld makes sense when you have S and not V
    br, Ajay M

  • About game programming.. please....help

    How to define game map for java midlet
         If I see the rpg game, it have default map. I want to know how to translate it to code
         in midlet? The map will be existed image or dynamicly generated?
         Like Prince of Persia Midlet version, I wonder how to generate the environment?
         Is it pixel generated or immutable image?
    detect collision
         SO if the map is image and the sprite game is draw over the map, how can we detect the
         collision?
         Please hellp me.... because I want to be game programmer for midlet but I
         didn't know about game programming before

    to write a small game in midl is already a hard work. to make a big one, take a look of a team of programers.
    about maping, there is no such thing. wire every thing by yourself. by books or read tutorials.
    as i already said. no easy task.
    but keep on trying. if you need some help write me a mail.
    [email protected]
    jeliel
    (sebastian)

  • MBPr - Resolution problem with games

    I have an issue with the resolution of my Macbook Pro with Retina Display while playing games.  For some reason it changes whenever I boot up a game, so that (in fullscreen), it's highly zoomed in to a specific corner of the game screen, making it unnavigatable. This is with official game apps from the App Store, like Doom 3 and Psychonauts.  Whenever I Force-Quit out, the display clearly has a much smaller resolution (text and icons are large) before going back to the normal, optimized for Retina resolution.  Please help!

    Hello
    I also had this problem and I've found a solution: it's due to the feature "Automatic graphics switching" being active. To prevent this from happening you need to disable it in System Preferences --> Energy Saver and uncheck this option. For further convenience you can install and use the application gfxCardStatus. Anyway, it's weird to have this happening in Doom 3 and have no issue in Quake 4.
    Hope I can helped.
    Best regards,
    Ruben P.

  • Help with making a back button

    hi
    in a game im making i have a start menu that then when you click play goes to the game after playing the game, when you die a game over screen appears with a play again button in it i want to put a back button to go to the first frame.
    the way this is set up is that the game over menue is a movie clip with the play again button in it i want to have a back movie clip to make it go to the first frame
    gotoAndStop(1) dosent seem to work or mabye i am doing it wrong
    this my game class file as the game over menu does not have a class file:
    package com.alienattack{
              import flash.display.MovieClip;
              import flash.events.Event;
              import flash.utils.Timer;
              import flash.text.TextField;
              import flash.text.TextFormat;
              import flash.display.Stage;
              public class Game extends MovieClip          {
                        static var ship:MovieClip;
                        static var enemyShipTimer:Timer;
                        static var scoreText:TextField;
                        static var score:Number;
                        static var healthMeter:HealthMeter;
                        static var enemyHealthMeter:EnemyHealthMeter;
                        static var gameOverMenu:GameOverMenu;
                        static var powerUpTimer:Timer;
                        static var miniBossTimer:Timer;
                        static var RocketShipTimer:Timer;
                        var bossCountdown:Number;
                        static var Bombtimer:Timer;
                        private var _stage:Stage;
                        static var backgroundMusic = new BackgroundMusic();
                        var Bullet;
                        public function Game(){
                                     this.addEventListener(Event.ADDED_TO_STAGE,init);
                        function init(e:Event):void{
                                  _stage=stage;
                                  KeyClass.initialize(stage);
                                  stage.focus = this;
                                  ship = new Ship();
                                  ship.x = 300;
                                  ship.y = 150;
                                  _stage.addChild(ship);
                                  enemyShipTimer = new Timer(2000);
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  enemyShipTimer.start();
                                  RocketShipTimer = new Timer(3500);
                                  RocketShipTimer.addEventListener("timer", sendEnemyRocket);
                                  RocketShipTimer.start();
                                  resetScore();
                                  gameOverMenu = new GameOverMenu();
                                  gameOverMenu.x = 0;
                                  gameOverMenu.y = 0;
                                  addChild(gameOverMenu);
                                  gameOverMenu.visible = false;
    gameOverMenu.playAgainButton.addEventListener("mouseDown", newGame); (this is where i think the play again button is but how would i make it so it when to the first frame)
                backgroundMusic.play(0,1000);
                        static function gameOver()
                                  gameOverMenu.visible = true;
                                  enemyShipTimer.stop();
                                  miniBossTimer.stop();
                                  RocketShipTimer.stop();
                                  Bombtimer.stop();
                                  powerUpTimer.stop();
                                  for (var i in EnemyShip.list)
                                            EnemyShip.list[i].kill();
                        function newGame(e:Event)
                                  gameOverMenu.visible = false;
                                  ship.visible = true;
                                  ship.x = 300;
                                  ship.y = 150;
                                  ship.takeDamage(-ship.maxHealth);
                                  ship.addEventListener("enterFrame", ship.move);
                                  resetScore();
                                  enemyShipTimer.start();
                                  miniBossTimer.start();
                                  RocketShipTimer.start();
                                  Bombtimer.start();
                                  powerUpTimer.start();

    hi
    i make a new function back and change the new game to back but the screen does not go to the first frame
    gameOverMenu.backbutton.addEventListener("mouseDown", back);
    function back(e:Event)
                                  gotoAndStop(1);
    any help?

Maybe you are looking for

  • How can I go back to a previous boot ROM version?

    Hi. I've been reading these forums for a long time...first time posting. The short story: I have a Macbook 5,2 running OS X 10.5 with boot ROM MB52.0088.B06, and I'd like to know how to flash the boot ROM version back to MB52.0088.B05. The long story

  • Multiple empty Last Import albums in iPad Photos

    I use the camera connection kit to pull photos from an SD card into my iPad 2. This has worked perfectly for about half a year. Recently after importing, I noticed that instead of a single "Last Import" album in the Photos app on the iPad, there were

  • Total Text Display at the end of the ALV

    Hi, I want to display the text 'TOTAL' in my ALV at the end of my report.I am pasting my code, So please any one help me in this issue. *& Report  ZFIR0011_O2C_TAX_GL_SUMMARY REPORT  zfir0011_o2c_tax_gl_summary. TYPE-POOLS slis. TABLES: faglflexa. Co

  • [SOLVED] KDE Won't loading

    Hello everyone. After reboot KDE won't loading anymore (after KDM login, stuck for ~30 sec at last stage and then appears only cursor). Here the my xerrors startkde: Starting up... Connecting to deprecated signal QDBusConnectionInterface::serviceOwne

  • HP C6150 and Mac OS 10.5.7

    I purchased my HP C6150 in June of 2007 and set up to use it wirelessly. No problems. This year I replaced the Mac I was using with a MacBook loaded with Leopard, MAC OS 10.5 and lost the ability to scan. I recently updated the Mac OS to 10.5.7 and h