hey can you explain me how to animate the character to follow the path please ??? i just finish my a star after trying to understand it but now i am stuck in the animation making the hero to follow the path to the target thank you....any code snipet or pseudo code will be appreciated
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 :).
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?
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.
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?
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
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.
This has been flagged as spam show
hey can you explain me how to animate the character to follow the path please ??? i just finish my a star after trying to understand it but now i am stuck in the animation making the hero to follow the path to the target thank you....any code snipet or pseudo code will be appreciated
real3rdlife 1 month ago
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)
phytra 2 years ago
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 :).
birdmanpete14 2 years ago
Ahh, that was what I was planning to do aswell.
But how big is your backbuffer image?
phytra 2 years ago
And one last question! (hopefully)
How'd you make the minimap?
My first guess would be very small tiles :p
phytra 2 years ago
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?
birdmanpete14 2 years ago
I figured how to do that (X coordinate clicked divided by the tile size)
Anyway - thanks for you help, good luck with your game.
phytra 2 years ago
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 :)
phytra 2 years ago
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.
birdmanpete14 2 years ago
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 ;)
phytra 2 years ago
Nvm about the tiles, I figured how to make them.
Cheers!
phytra 2 years ago
Love the work princess. When is the release date?
You need to imporove the look of the trees though
SuperBilljones 2 years ago
good job man keep it up
xxtylerxx1 2 years ago
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?
skoidat 2 years ago
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.
birdmanpete14 2 years ago
Yaay!!!
Cool. it's looks like real game :)
Good job!!!!
sharavsambuu 2 years ago
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
acccrew01 2 years ago
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.
birdmanpete14 2 years ago
wow, you took the renders/artwork/textures/animations etc all from ra95!? Whats this running on vista? Future plans? Multiplayer? Very interested!
acccrew01 2 years ago
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 ).
birdmanpete14 2 years ago
very very nice peteson :) keep training those java skills <3
Javier2910 2 years ago
Great vid birdmanpete14! can't wait to see the finished game...
SillygooseSillygoose 2 years ago
Comment removed
SillygooseSillygoose 2 years ago