MCPcopy Create free account
hub / github.com/electronstudio/raylib-python-cffi / process

Method process

examples/extra/extra_flow_field.py:56–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54 self.pre = glm.vec2(pos)
55
56 def process(self):
57 if CTM() > self.start + 50:
58 self.ang = math.radians(glm.simplex(self.pos) * 360.0)
59 self.start = CTM()
60
61 self.rot = glm.vec2(
62 glm.vec4(1) * glm.rotate(glm.mat4(), self.ang, [0, 0, 1])
63 )
64 self.pre = int(self.pos.x), int(self.pos.y)
65 self.pos += self.rot * rl.GetFrameTime() * 64
66 rl.DrawLine(
67 int(self.pos.x), int(self.pos.y), *self.pre, self.clr
68 )
69
70 if self.pos.x < 0: self.pos.x = rl.GetScreenWidth() - 1
71 if self.pos.y < 0: self.pos.y = rl.GetScreenHeight() - 1
72 if self.pos.x >= rl.GetScreenWidth(): self.pos.x = 0
73 if self.pos.y >= rl.GetScreenHeight(): self.pos.y = 0
74
75 hlf = self.scl // 2
76 self.mem = int(self.pos.x) - hlf, int(self.pos.y) - hlf
77 rl.DrawRectangle(
78 *self.mem,
79 self.scl if not BEES else hlf,
80 self.scl,
81 self.clr
82 )
83 if BEES:
84 rl.DrawRectangle(
85 self.mem[0] + hlf, self.mem[1],
86 hlf,
87 self.scl,
88 [0, 0, 0, 55]
89 )
90
91dims = rl.GetScreenWidth(), rl.GetScreenHeight()
92ini = False

Callers 1

Calls 1

rotateMethod · 0.80

Tested by

no test coverage detected