Added: 2 years ago
From: birdmanpete14
Views: 2,297
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (17)

Sign In or Sign Up now to post a comment!
  • Regarding scrolling - I've created a game which uses tiles 75x75, so should I plus the offset to the position of each tile? (x + xoffset)

  • Depends on how you have implemented your offset variable. Mine is simple and goes like this (ignoring minimap operations) :

    When the mouse goes to the right of the screen, the xoffset variable gets incremented, when it goes to the left of the screen the xoffset gets decremented. Then all units/terrain/buildings are drawn at their position MINUS the x-offset.

    So that way, when you scroll the screen to the right, everything on the screen moves to the left :).

  • Ahh, that was what I was planning to do aswell.

    But how big is your backbuffer image?

  • And one last question! (hopefully)

    How'd you make the minimap?

    My first guess would be very small tiles :p

  • Sort of.

    When the game is initialized, the background is scaled and drawn onto a smaller buffered image (background of the minimap). Every few game cycles (I've changed to real time refreshing) the minimap clears its offscreen, then redraws the "units" at their new positions.

    I'm not sure what you are trying to do with the X coordinate thing. Are you trying to find the x coordinate of the tile the mouse just clicked on?

  • I figured how to do that (X coordinate clicked divided by the tile size)

    Anyway - thanks for you help, good luck with your game.

  • Hey I have a couple of question, I recently got into java - hope you'll take time to answer them :)

    1. How did you make the game scroll - is that Parallax scrolling?

    2. When you move your units, how did you make it go on a certain path?

    Thanks :)

  • 1)Nah it is not parallax scrolling. This is a test map I created which is an island (look at 0:36). It might look like parallax scrolling cause this version has no other terrain :(.

    The game scrolls by (simply) having a few variables which are "offsets", which determine how far the "screen" has moved in the x and y directions.

    2)The map is broken up into tiles (almost standard for RTS games), and I've then used a pathfinding algorithm.

    Search "A* for beginners" in Google - its the first link.

  • Ah, cool :)

    I just dont get the split into tiles thingy. I mean, let's say you do some action when the mouse is pressed..

    Then I'd do as following

    int X = e.getX() - (e.getX() % 100);

    This will round down or up, to a X coordinate, which is dividable by 100..

    What would you do?

    Thanks ;)

  • Nvm about the tiles, I figured how to make them.

    Cheers!

  • Love the work princess. When is the release date?

    You need to imporove the look of the trees though

  • good job man keep it up

  • I'm fairly new to programming, I chose Java because there arn't very many PC games programmed using it, reason being many people hear negative things about Java and gaming as one. I'm sure you know what those rumors are. This is an excellent example of what Java can do. Your game look like it ran very smooth. Did you go to school for programming or are you DIY? If DIY tell me how you learned?

  • I've had a bit of professional training in programming - however the majority of this work is the result from my own learnings.

    I learnt through much practice -look online, there are many tutorials out there about programming graphics and games.

  • Yaay!!!

    Cool. it's looks like real game :)

    Good job!!!!

  • cool, Id say you should just aim for multiplayer, Not sure if anyone would actually like to play such an old game if its only single player.. Would cut out alot of work for you to.. I actually finally got it working on vista 64bit but with a few problems, PC is far to powerfull and the scroll rate is WAY TO FAST!!! cant turn it down any lower lol,, and resolution is abit low.. I like to run very hig resolutions.. That and bigger maps would be good with upto 6 ppl multiplayer

  • Thanks for your suggestions.

    Yeah that fast scroll rate was VERY annoying for me as well. Multiplayer will definitely be the focus for this game. Also, this version of the game is very outdated he he.

  • wow, you took the renders/artwork/textures/anima­tions etc all from ra95!? Whats this running on vista? Future plans? Multiplayer? Very interested!

  • Hehe yep!

    It's running on XP :P.

    Multiplayer for certain.

    Future plans: create a complete game similar in gameplay to RA 1 (identical in graphics ).

  • very very nice peteson :) keep training those java skills <3

  • Great vid birdmanpete14! can't wait to see the finished game...

  • Comment removed

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more