News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

dinofun (more gdi testing)

Started by felipe, April 05, 2018, 01:47:15 PM

Previous topic - Next topic

LordAdef

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

Quote from: LordAdef 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.
Thanks for sharing
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding