Skip to content

Instantly share code, notes, and snippets.

@thegoldenmule
Created January 22, 2024 16:52
Show Gist options
  • Save thegoldenmule/5d6b516de0a1abf3021180240f6c43ac to your computer and use it in GitHub Desktop.
Save thegoldenmule/5d6b516de0a1abf3021180240f6c43ac to your computer and use it in GitHub Desktop.
Vector example from class.
const vec2 = glMatrix.vec2;
window.init = (canvas) => {
console.log('Init()!!!!!!!!!');
// TODO
};
window.loop = (dt, canvas) => {
const ctx = canvas.getContext('2d');
const center = vec2.fromValues(
canvas.width / 2,
canvas.height / 2,
);
ctx.moveTo(center[0], center[1]);
const direction = vec2.create();
const rotated = vec2.create();
const down = vec2.fromValues(0, -1);
vec2.rotate(
rotated,
down,
vec2.create(),
Math.PI / 6);
vec2.scale(direction, rotated, 100);
ctx.lineTo(center[0] + direction[0], center[1] + direction[1]);
ctx.stroke();
};
@ericabolton245
Copy link

The growth and popularity of online games in Slovenia have been remarkable over the past few years, especially on platforms like Sloterman-SI. This surge can be attributed to a combination of technological advancements, increased accessibility, and the wide variety of engaging games available for players. Online games, particularly those focused on slots and interactive entertainment, have found a dedicated audience in Slovenia, and their appeal continues to expand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment