Author Topic: dinofun (more gdi testing)  (Read 1080 times)

LordAdef

  • Member
  • ****
  • Posts: 604
Re: dinofun (more gdi testing)
« Reply #15 on: May 24, 2018, 09:24:54 PM »
hi, yep. It starts with an ascII file for each map. It’s then parsed and compressed by code. When loaded, we have this big array of 0/1. 0 for vaild spaces, 1 for forbiden terrain.


it’s in fact an array of pointers under the hood.


The collision detection is simple, once we convert the xy screen coordinates and compare with what there is in the array for that spot.


It’s slightly harder for my plane’s bullets, since they travel upwards, while the map scrolls downwards. But it’s just simple maths and comparing areas for intersection.


jumping is rather easy too. I usually do as Daydreamer already said.

daydreamer

  • Member
  • ****
  • Posts: 557
  • reach for the stars
Re: dinofun (more gdi testing)
« Reply #16 on: May 25, 2018, 04:59:59 AM »
hi, yep. It starts with an ascII file for each map. It’s then parsed and compressed by code. When loaded, we have this big array of 0/1. 0 for vaild spaces, 1 for forbiden terrain.


it’s in fact an array of pointers under the hood.


The collision detection is simple, once we convert the xy screen coordinates and compare with what there is in the array for that spot.


It’s slightly harder for my plane’s bullets, since they travel upwards, while the map scrolls downwards. But it’s just simple maths and comparing areas for intersection.


jumping is rather easy too. I usually do as Daydreamer already said.
Thanks for sharing
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*