Platane / snk

🟩⬜ Generates a snake game from a github user contributions graph and output a screen capture as animated svg or gif
https://platane.github.io/snk
4.39k stars 1.11k forks source link

[Feature] Pertaining to the shape of a snake #61

Closed ramazansancar closed 1 year ago

ramazansancar commented 1 year ago

I created the code for the triangle svg drawing. However, I have no idea how to proceed. Can you help me?

https://github.com/ramazansancar/snk_readme/blob/main/packages/types/point.ts#L10

export const aroundTriangle = [
  { x: 1, y: 0 },
  { x: -1, y: -1 },
  { x: -1, y: 1 },
] as const;
Platane commented 1 year ago

The around4 const is used to iterate over all directions. It's used in several places to traverse the grid. I don't think it does what you think.

What do you want to achieve ?

ramazansancar commented 1 year ago

The around4 const is used to iterate over all directions. It's used in several places to traverse the grid. I don't think it does what you think.

What do you want to achieve ?

I want to make the square shape of the snake triangular.

Platane commented 1 year ago

Ok, then you might want to look at https://github.com/Platane/snk/blob/main/packages/svg-creator/snake.ts ( for svg rendering )