If the brush stroke is just beginning (firstDraw is still true), lastDrawX and lastDrawY still have their default values of zero, so no making a decision based on how far the cursor has moved, we (or main) will just arrange to draw a shape anyway. ( firstDraw) outside main to keep track of whether this is the first time main does something (keeping track of minions - are you starting to feel like a supervillain script writer yet?). Main also needs to remember whether this is the first time main has been asked to do something (the brush stroke has just started), so whether these variable-bots are remembering real position values from FireAlpaca, or they still have their default 0 values straight from the fabricator. We will set them up as lastDrawX and lastDrawY, and start them off at the very beginning, fresh from the fabricator, with default values of zero. These new variables we will create need to remember stuff even when main has passed control back to FireAlpaca, so they go outside of the function main, although main (being an important chief minion) can still give them a value to remember. The other local-variable-bots forget their values every time control is passed back to FireAlpaca, main needs to tell them what to remember every time,100 times per second. In this case, the shapes will be more-or-less edge-to-edge.įirstly, we need to make some variable-bots of our own. We will base that shape on the current width of the brush (which includes pressure) so that larger shapes are spaced further apart. What we will do this time, instead of just drawing a shape and stamping it on the screen 100 times per second, is only draw a shape when the brush has moved a minimum distance. This is where you find out if you are ready to be a supervillain - I mean, brush script writer. It is time to start thinking about serious control issues. 5 notes Making brush scripts, part 4 Minion with control: A respectable brush script
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |