Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Glow Bug
#4
(9 hours ago)SierraKen Wrote: I tried a couple different ways to make more than 1 bug at a time, but does anyone know how to do that? That is why I converted it to SUBs. But just using SUBs doesn't seem to work. I even tried 4 different sets of SUBs for 4 bugs, with all different variables, but there was still 1. I then tried to chain the SUBs, going from SUB 1, to 2, to 3 to 4... that didn't work either. I didn't save any of that code, although I should have. Any ideas?

Wouldn't you need to convert these to working with an array to use more than one bug?

All you're using here is a single set of variables which get passed back and forth via the parameters, so they're never going to change.

Instead of the second sub being called morebugs, you really should call it SUB drunkbug. It doesn't make an extra bug; all it does is change the direction that the bug is currently traveling in, making it wander somewhat across the screen at random intervals.

At no point, however, are you tracking variables for multiple bugs across the screen. Everything is working and resolving for a single set of x/y coordinates, so it's not going to make more bugs for you just by calling the morebugs routine.



Even more oddly is why your main loop is inside your SUB bugs itself. What's the point of the other DO.. LOOP in the main module? It's only ever going to call the SUB once and then get trapped inside that endless loop until program end.

The flow on this has me more than a little confuzzled.
Reply


Messages In This Thread
Glow Bug - by SierraKen - 10 hours ago
RE: Glow Bug - by SierraKen - 10 hours ago
RE: Glow Bug - by SierraKen - 9 hours ago
RE: Glow Bug - by SMcNeill - 8 hours ago
RE: Glow Bug - by bplus - 8 hours ago
RE: Glow Bug - by SierraKen - 5 hours ago
RE: Glow Bug - by PhilOfPerth - 2 hours ago



Users browsing this thread: 2 Guest(s)