This site requires JavaScript, please enable it in your browser!
Greenfoot back

Comments for Mars Patrol

Return to Mars Patrol

mjrb4mjrb4

2009/5/10

Nice! I haven't seen this game before but it looks well written and nicely playable. Good job :)
maybe use a integer value for change in y-coordinates to make jump more realistic? Great game :)
Cash_CashCash_Cash

2009/5/11

I tried making the jump/fall realistic using vector before (increase and decrease rise/drop exponentially) but sometimes the tank sinks into the ground, which makes it really glitchy and annoying :S so i'm sorry if I cannot make the jump/fall realistic with gravity. Anyways, it's MARS :D haha great excuse for not having gravity LOL Thanks for trying out my game, I will continue to improve and update the game!
mjrb4mjrb4

2009/5/11

You don't really need to use the vector class (you can, but personally I wouldn't implement it that way.) True it is trickier to implement realistic gravity, but it is possible - basically the method I use has involved using getObjectAtOffset to look "ahead" so to speak and restrict the movement if the object is just about to approach the ground. "great excuse for not having gravity" Of course Mars has gravity! Everything with mass does technically speaking, but Mars definitely has enough mass to have a noticeable amount of gravity. It's only about 38% of earth's, but it's still there!
MuZiKMuZiK

2009/5/11

A gameover screen would be helpful. The first time i lost I thought it had just frozen.
pollepolle

2009/5/15

Nice game. The different scrolling speeds that are used for the ground and background gives a good effect.
Cash_CashCash_Cash

2009/5/16

thanks for the comments. maybe i'll come with an updated version a week or so later. (:
FreezerstingFreezersting

2009/5/20

Definately voted. Great playability and overall aesthethic and game appeal :]
Great Playability, graphics are good considering your lack of experience in the field. I personally like the game play, and in my own opinion, that also allows me to easily overlook the weakest link, your graphics. It has a sense of professionalism, and unlike certain other scenarios I've encountered, in which the graphics outshine the actual game itself the game is actually FUN and does not hide under the veil of an artistic design
ChinncChinnc

2009/5/21

just to add on to surrealdesire's comments, i think the only real "problem" with your scenario is that if there is a hole on the ground and a helicopter drops a bomb onto the pavement just ahead, theres just about no way to get through that since the helis tend to spazz out in the front for a bit before coming to bomb you. however, the limited space your tank is allowed cant reach far enough.
Cash_CashCash_Cash

2009/5/22

there shouldnt be a problem because I have taken this into account - the tank can jump over 4 ditches in a row (max ditches that can naturally occur), and if not there would be gaps between them where the tank can land for another jump. my source code is available for download if u wish to fix it (moving/jumping and ditch spawning limits), or if you want to copy my whole scenario to fix some indentations and speed.
ChinncChinnc

2009/5/22

if the ditches are only about 8mm in width apart (which sometimes they are), then the chances of surviving are about one to a billion
ChinncChinnc

2009/5/22

especially since you cant really land on the 8mm ground or else you blowup
Cash_CashCash_Cash

2009/5/22

which part of my explanation do you not understand? 1. ditches have been tested and it is very possible to get past them, just get more practice maybe? =S 2. if you wish to copy/fix my scenario's "code" then go ahead and download it
ChinncChinnc

2009/5/22

just to follow up, heres an example, http://i208.photobucket.com/albums/bb273/Chinnc/usesomebrainsnoob1.jpg - that is the moment i am about to die, notice there are two bombs ahead which are probably not affected by the ditch spawn rate. and here is the moment in which the tank blows up - http://i208.photobucket.com/albums/bb273/Chinnc/usesomebrainsnoob.jpg this should be attributed to the glitchy jump, there's a cool metroid prime nes scenario that has a gravity code, try viewing that and see if you want to add it into the game
ChinncChinnc

2009/5/22

a glitchy jump prevents me from shooting (aiming) or jumping properly, especially as the landing is slow. ps, no need to get aggressive, merely things i wished to point out. heed the advice if you will, and do not if you wont
Cash_CashCash_Cash

2009/5/22

OH i understand. you just didn't shoot, because the explosion is from the side of tank, it means you hit the barrel. if it hits the ditch it will explode on the bottom. I assure you, there are no glitches with the jump or jump distance okay? promise i've tested it so many times. (:
Cash_CashCash_Cash

2009/5/22

just hold space to shoot, press up to jump. the shooting and jumping are two different methods, so if there are glitches they won't be interlinked. and please, download my scenario so you can copy it and try fixing some of them k? cheers mate! :D
fatfatfatfat

2009/5/23

LOL if you cant play the game well dont blame the programmer
ChinncChinnc

2009/5/23

@cashcash i was holding down spacebar so the rockets should have been spamming (which they were, no errors there) but the moonjumping gave me a hard time with more than three holes in a row, but its fine, we see things differently and i will not ask you to change your game, do as you see fit @fatfat im not blaming the programmer, merely pointing things out that could possibly improve, whether he heeds my advice/comments is up to him
Errr. hate to disagree mates but. uhm...so far no ones has found a problem with the scenario except you Chinnc. so..maybe it was a one time glitch? your computer? maybe the scenar just doesn't like you :S I've played this game and i have yet to encounter that problem..just saying.
mjrb4mjrb4

2009/5/23

Well, I think I get the problem chinc's describing, sometimes it is difficult to jump when there's lots of holes that have been formed in a row. But every time I've died so far, while that problem was due to too many holes, I'm pretty sure with better positioning on my part I could've overcome the problem and made it across. There MIGHT be situations where it is actually impossible, but I would've thought that could be classed more as a feature than a bug, and it'd probably require a lot of code reworking to fix if it was there at all (note: probably not worth it.) I'll grab the source and have a look at it when I get round to it to see if I can see anything that's wrong and perhaps demonstrate how to include "normal" jumping - I'll post back when I've poked around a bit. While I'm at it, to point out a couple of comments I noticed: "maybe it was a one time glitch? your computer? maybe the scenar just doesn't like you :S" Logical deduction perhaps, but it's very unlikely that it'll work slightly differently on one computer to another due to how Java works - generally the scenario will either work or it won't. You can generally rule that out unless it's a big undisputable thing that's clearly different (like a non-working applet with a huge error message for example!) "I assure you, there are no glitches with the jump or jump distance okay? promise i've tested it so many times. (:" However many times you test something, this never really guarantees that it's completely fault free! One of my friends coded a web mashup the other day, and was absolutely sure it always worked and validated. I loaded it 2 times and there was a big tag floating in the middle of the page, and yup, the HTML that the php script stuck out was indeed invalid. Just one example, and I'm not saying there ARE glitches in your code at all - just be aware that that's quite a bold statement to make!
Cash_CashCash_Cash

2009/5/24

the way i tested it was not by running the scenario over and over again. I actually placed four holes with gaps that the tank is unable to land on and tested the jumping distance, because the max number of holes that will appear in-a-row is 4. Otherwise, the world will stop spawning holes and the helicopter will not drop more bombs :/
Cash_CashCash_Cash

2009/5/24

wait my mistakes, it wont stop dropping bombs. but it can only drop 2 bombs in a row, which will then create a gap the tank should be able to land on.
GreenThumbGreenThumb

2009/5/24

Graphics are alright. Gameplay+Concept, are amazing. Downloaded the source code, pretty interesting approach
Cash_CashCash_Cash

2009/5/24

thank you everyone for trying my game out and commenting on it, truly appreciate that. please "like" it if it's up to your standards! :D
mjrb4mjrb4

2009/5/24

Well I've just got a chance to download and look at the source :-) Firstly - very well done on this front! It's good to see things commented nicely all the way through, proper indendation, and all fields set to private, and as a result I could easily navigate my way through your source. These things do make a big difference! Now onto the method of jumping, these are the changes I made to include "smooth" jumping rather than just up and down: - Firstly, make jumpFall a double and initialise it to 0. This will be the amount that we're travelling by vertically. - Next, I changed your checkJump method to: | public void checkJump() | { | if ( Greenfoot.isKeyDown("up") && onGround() ) | { | Greenfoot.playSound ("jump.wav"); | setLocation(getX(), getY()-1); | jumpFall = -5; | } | } This just sets jumpFall to (you can change this depending on how far you want to jump, or put it as a field.) - Finally, I modified your descend method thus: | if ( !onGround() ) | { | Ground g = (Ground)getWorld().getObjects(Ground.class).get(0); | int maxFall = g.getY()-getY()-g.getImage().getHeight()/2-getImage().getHeight()/2; | System.out.println(maxFall); | if(maxFall<jumpFall) { | jumpFall = maxFall; | } | setLocation ( getX(), (int)(getY() + jumpFall)); | } | jumpFall+=0.1; This is probably some of what you tried before - it increments jumpFall by a value (0.1), and if we're not on the ground it moves the tank in the Y axis with the value of jumpFall. However, to stop the Tank sinking into the ground it has an extra bit. We first get the distance between the bottom of the tank and the top of the ground: int maxFall = g.getY()-getY()-g.getImage().getHeight()/2-getImage().getHeight()/2; As you can see, this just involves getting the y position of the ground, then taking away the tank's y position, then taking away half the height of the image's of each of the ground and tank. After we've got this, we can then test to see if jumpFall is greater than maxFall, and if it is we can just set it to maxFall, preventing the tank from sinking into the ground :-) Michael
mjrb4mjrb4

2009/5/24

Ignore the System.out.println statement in the above code by the way, you can get rid of that - I had it in for debugging purposes to find out what silly mistake I'd made ;)
Cash_CashCash_Cash

2009/5/24

haha yes the real problem is that if there's gravity, the tank sinks into the ground. but since you fixed this problem, O_O omg i'm so glad!! (: thank you so much. will release a better version soon. cheers mate :D