cdeevfrr / Photon

A video game
GNU General Public License v3.0
0 stars 0 forks source link

Autogenerate empty nodes #24

Open cdeevfrr opened 2 years ago

cdeevfrr commented 2 years ago

If a position attempts to move into a node that doesn't exist:

EX in 2d (photon is P, it's moving up, bottom left E is [0,0]):

EPE
EEE
EEE

Create new node with coords [1, 3]

 N 
EPE
EEE
EEE

Check for P's left neighbor's up. If exists, connect to the new node

?  N
^
E<-P  E
E  E  E
E  E  E

Same check for p's right neighbor's up.