Log In  

Here is my collaboration with the ultra-famous youtuber, Parker Morgan. Search him up.

Cart #badgamist-2 | 2023-08-18 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
3

P#119171 2022-10-16 02:03 ( Edited 2023-08-18 07:03)

There's a couple of things I see:

  1. In init() you're calling make_powerup(x,y) but I don't see that x & y are defined anywhere. (but it looks like you are hardcoding those values later in the function, so this doesn't matter).

  2. In make_powerup(x,y), you do e.type=rnd(3). That is likely not going to be an integer value, it'll be something like 0.8467. If you're looking for an integer value between 0-3, you want to do flr(rnd(4)) instead.

  3. The other thing I can't find is where you define the powerup table. You call add(powerup,e) in the make_powerup(x,y) function, but powerup isn't defined anywhere. My guess is that this is where your problem comes from.
P#119173 2022-10-16 02:18 ( Edited 2022-10-16 11:47)

[Please log in to post a comment]