Author Topic: Grappler!  (Read 30208 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #195 on: December 18, 2011, 10:43:43 pm »
Ok, I wrote some subroutines for the collisions. It works, but there are many bugs such as falling through floors or getting stuck in walls. Also the enemy seems to kill you immediately if you start moving as soon as the loop begins :P

There are also lots of other screw ups that show up occasionally. 

Thanks for the collision idea, leafy!
« Last Edit: December 18, 2011, 10:55:43 pm by epic7 »

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Grappler!
« Reply #196 on: December 19, 2011, 04:40:50 pm »
wow.  This game looks amazing.  I love how you're using the ropes.

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #197 on: December 19, 2011, 04:41:57 pm »
Thanks! And... What ropes? :P
(You mean how grappling hooks use rope?)

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #198 on: December 19, 2011, 07:28:35 pm »
I might have to make all blocks solid for doing pxl-tests unless I find a better way....

Textured blocks are what's causing me to get stuck in bricks I think.

After that, I'll still have to tweak my subroutines.

Also, made a userbar in paint!
|
V
« Last Edit: December 19, 2011, 07:30:13 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Grappler!
« Reply #199 on: December 19, 2011, 07:30:31 pm »
Use virtual pixel tests :D They function exactly like pixel tests, but return the solidity of a pixel instead of the color

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #200 on: December 19, 2011, 07:35:32 pm »
Question Bombardment:
So copy gdb to L1?

Do I need masks if I only have a few triangle tiles that will be fully solid?

I don't understand what N is for.

Do X and Y need to be in r1 and r2?

Do I need to divide X (or r2) by 256 if its inflated?

W is tilemap width (in tiles) right?
« Last Edit: December 19, 2011, 07:43:07 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Grappler!
« Reply #201 on: December 19, 2011, 07:58:09 pm »
So copy gdb to L1?
L1 is just the pointer to your tilemap data.  Replace L1 with the pointer to your tilemap data

Do I need masks if I only have a few triangle tiles that will be fully solid?
You only need masks if you want your tiles collision to be anything other than a square

I don't understand what N is for.
N signifies the number beyond which all tiles are solid.  For example if your first 3 tiles were scenery, and not solid, you would use 3 for N.  The routine tests for the tile number, and if it is greater than N, it considers the tile solid.  By ordering all of your tiles empty first, followed by solid, you can make this really easy.

Do X and Y need to be in r1 and r2?
r1 and r2 are the X and Y onscreen coordinates, measured in pixels from the top left corner of the tilemap.  If your coordinates are inflated, you don't want to use the inflated version, but first de-inflate them to get the onscreen pixel coordinates.

W is tilemap width (in tiles) right?
Yes

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #202 on: December 19, 2011, 08:13:48 pm »
So for L1 do instead
[lotsa hex]->L1
But I'll have many different tilemaps, so they can't all be stored to L1...

r1 and r2 are the player coordinates from the top left corner of the map, not the coordinates on the screen, correct?

If I have no scenery, N will start at 0, so then it will check if it is less than 0??


Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Grappler!
« Reply #203 on: December 19, 2011, 08:16:41 pm »
You don't need to use L1, as I was saying replace L1 with the pointer to your tilemap data.  You could replace L1 with Str01 if that was where your tilemap data was stored.

And if the only empty tile is 0, you would want to check if the tile number is greater than zero if you were checking for a solid tile. 

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #204 on: December 19, 2011, 08:18:45 pm »
So... What do I do if I have no scenery?
Wait... Do empty 00 tiles count as scenery?
« Last Edit: December 19, 2011, 08:21:53 pm by epic7 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Grappler!
« Reply #205 on: December 19, 2011, 08:22:16 pm »
Like I said, if the only empty tile is tile#0, you would want to check if the tile number is greater than zero to detect a solid tile

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #206 on: December 19, 2011, 08:23:45 pm »
So then
If {r2/8*W + (r1/8)+L1}
Will check collision?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Grappler!
« Reply #207 on: December 19, 2011, 08:25:34 pm »
If L1 points to your map data, then yes

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #208 on: December 19, 2011, 08:31:22 pm »
:D
Ok, I'll replace my pxl-tests and eventually post the outcome, hopefully good :P

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Grappler!
« Reply #209 on: December 21, 2011, 06:55:09 pm »
I did it, but it fails <.<

It gets frozen and I have to pull a battery.

Methinks the while statement screwed up and won't ever be false, causing infinite loop.

But however, the tilemap should show up if everything else does...

Actually, it never should virtual pxltest until the player moves.
The only one that works when the player is moving still uses the regular pxl-test (which I forgot to change) and it used to work.
« Last Edit: December 21, 2011, 06:57:34 pm by epic7 »