Reply to comment

Matt Barton
Matt Barton's picture
Offline
Joined: 01/16/2006
Version 1.04

Another update - I added a set of illustrated instructions (thanks, Rob) and also fixed another little bug that happened if you clicked the left button too fast after starting the game. Also added version number to the top right corner - this is version 1.04.

Clok - happy to help however I can. I had to learn the hard way on most of this stuff since I could never seem to find exactly what I was looking for. Working out the collisions was the hardest part...Damn jeepney kept getting stuck on walls when you turned. I finally worked out to make a shadow copy of it and turn that one first to see if it hit a wall; that way I could tell the main jeepney not to turn. Then Elizabeth managed to get it stuck again! So I had to add another routine that turned you just a little bit if you got parallel right next to a wall.

There's built-in routines for changing the image angle, which is nice, but it does lead to complications. The built-in collision routines work fine for round objects, but once you get oblong stuff rotating it gets complex. The functions to get something to shoot out of a barrel instead of the center of the object are interesting -- lengthdir_x and lengthdir_y. You basically work out the angle you want using point_direction and adjust the x and y coordinates with x + lengthdir_x(length, angle), y + lengthdir_y(length,angle) where length is how much space you have from the origin or center of the object to the end of the barrel.

I imagine you could simplify things a lot if you put your barrel smack in the middle of your tank rather than on the back like I have mine. That required a lot more work.

Matt Barton, Managing Editor
Location: St. Cloud, Minnesota, USA
Email: matt@armchairarcade.com

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <i> <b> <img> <div> <span> <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption> <iframe>
  • You may post PHP code. You should include <?php ?> tags.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Images can be added to this post.
  • You may quote other posts using [quote] tags.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.