| ~Hakurei Shrine~ > Rika and Nitori's Garage Experiments |
| Boss Movement script. |
| (1/2) > >> |
| zage:
Well I've been searching through some Tuts and I can't find anything on boss movement. Can someone help me? |
| Naut:
Yeah, we don't have anything on Boss Movement yet, so here's the basics. Hopefully you'll understand, since I won't be going as in-depth as a tutorial would: SetMovePosition01(X-coordinate, Y-coordinate, velocity); Tells Danmakufu to make the boss start moving towards the X and Y coordinates specified, with the velocity you declare. Typically we use SetMovePosition03 instead of this one, because this one isn't very fluid. SetMovePosition02(X-coordinate, Y-coordinate, frames); Tells Danmakufu to make the boss start moving towards the X and Y coordinates specified, taking "frames" long to get there. 60 frames is one second, 120 frames is two seconds, etc. SetMovePosition03(X-coordinate, Y-coordinate, weight, velocity); Tells Danmakufu to make the boss start moving towards the X and Y coordinates specified, with the velocity you declared. This is a special movement function which includes "weight", which tells Danmakufu to make the boss decelerate as it's reaching it's goal, making a more fluid motion. A higher weight value will make the deceleration more sudden. I'm ignoring SetMovePositionHermite(); because it is beyond my level of understanding. Probably doesn't have much use unless you want your movements to be really fluid and presice. SetMovePositionRandom01(X-distance, Y-distance, velocity, left-boundry, top-boundry, right-boundry, lower-boundry); Tells Danmakufu to make the boss move around randomly inside a rectangle that you declare. The boss will move the X and Y distance you tell it to, with the velocity you declare, within the rectangle you designate by declaring it's left-most coordinate, upper-most coordinate, right-most coordinate and lower-most coordinate. You would use these functions just like calling a bullet in @MainLoop: --- Code: ---frame++; if(frame==120){ SetMovePosition03(GetCenterX, GetCenterY, 10, 3); } --- End code --- Tells the boss, at frame 120, to move towards the center of the playing field with a moderate velocity and decelerate as it's reaching it's goal. |
| Halca:
I want to have constant random movement for my spell card using SetMovePositionRandom01. How can I do this? |
| Naut:
--- Code: ---frame++; if(frame==120){ SetMovePositionRandom01(rand(10, 50), rand(10, 50), 2, 100, 40, 348, 150); frame = 60; } --- End code --- Set your movement distance to be randomly generated (first two parameters), set the speed she'll that she'll move at (2) and set the boundry (left: 100 pixels, or somewhat close to the left side of the screen. Top: 40 pixels, or close to the top of the screen. Right: 348 pixels, or 100 pixels from the right side of the screen. bottom: 150 pixels from the top of the screen, or 90 pixels above the center of the screen). She will move randomly inside this boundry for the whole spell, because we reset "frame" to a lower number, so the code will repeat itself for another random location. |
| Halca:
Thanks again :) |
| Navigation |
| Message Index |
| Next page |