I'm having trouble making a horizontal (coming out of the screen) pole swinging mechanism for a game I'm working on, but before I get into the problem, I should probably explain how my engine works. The whole character movement is based around four fastloops, one for each direction (up, down, left, right), which move the character and all associated parts/detectors one pixel, then check for collisions. Which loops are triggered depends on the direction (controlled by the player's alterable value B), and the state (walking, jumping, falling, etc.) of the player. How many times a loop is triggered depends upon alterable values A & B of a static active object for X and Y movement respectively. When the player's flag 0 is off, then those values are in a set proportion to a speed counter (10 - 40), but I can directly control them if I turn the flag on. When the alterable value A of the bottom detector is greater than zero, I subtract one from it, then trigger the "Up" loop however many times is dictated by the rate object's alterable value.
Anyway, after you touch a horizontal pole, you automatically start swinging clockwise or counter-clockwise depending on your initial direction. The animation direction of the swinging is determined by "Back Hand"'s alterable value A going from 0 to 31, cycling and resetting in the proper direction. When the player presses Fire 1, I convert the direction to degrees by the equation (Value A( "Back Hand" ) + 1 ) * 360 / 32. I tried to set the jump height to sin(angle) * 40, the X rate to Abs(sin(angle)* speed / 5), and the Y rate to Abs(cos(angle) * speed / 5), but it only seems to work properly in quadrant I (0 - 90 degrees, East to North). I'm sure there's an easier way than coding each angle individually, so what values should I use?
Edited by the Author.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
Okay, my equations are right. Sine is only positive in quadrants I and II, and cosine is only positive in quadrants I and IV. However, with a little experimenting, it seems as if TGF with the Advanced Math Object isn't recognizing negative trigonometric answers. Importing my engine into MMF, and replacing all Advanced Math Object code with MMF's built-in trig functions, it works. I had hoped to procrastinate as long as possible, but now it looks like I have to learn MMF. I love its power, but absolutely hate the counter-intuitive interface choices...if only it had kept TGF's! Anyway, here's some more n00bish questions for those too daunted by the long explanation earlier to reply :
1. How the heck do you change the size of an object in the picture editor, or even check at glance each animation frame's dimensions? I relied on the simple edit boxes where you could quickly change dimensions, hotspots, or action points in TGF, so where's the equivalent?
2. Is there any way to change the default transparent color from white to that fugly bluish green color in TGF? I hate not being able to tell at a glance whether a pixel is white or actually transparent.
3. While I'm asking, does anybody remember what keyboard shortcut let you automatically center the hotspot in an active object?
Edited by the Author.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
Thanks! MMF's help and on-CD tutorial was frustratingly useless. Sorry, but I have another question: how do you draw circles and ellpses from their centers, like in TGF?
Edited by the Author.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
Thanks anyway. I come again with yet another question.
How do you import outside files as specific animation frames? Fiddling around, I figured out how to create a one-framed active object by create new object...from file, and the File->Import->Bitmap menu item, but it doesn't seem to actually import it as an animation frame.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames