Is there any easy-ish or a universal way to tilt 3d objects? I can't figure out how to tilt/rotate the 3d objects I make... for example... a simple cube is like this
ascent(i in 0..4)
{
SetGraphicAngle(i*90, 0, 90);
DrawGraphic3D(45*sin(i*90), 0, 45*cos(i*90));
}
SetGraphicAngle(90, 90, 90);
DrawGraphic3D(0, -45, 0);
DrawGraphic3D(0, 45, 0);
Note: I'm not that sure... I haven't tested it (no danmakufu in this comp), but you get the point...
Now, how would I tilt that cube? to for example, a cube standing on one point...
To rotate an object in 2D, you would specify a point to rotate about, get the distance and angle to that point, and move it by incrementing the angle while keeping the distance the same, correct? At the same time, you would need to rotate the graphic at the same speed that you are incrementing the angle.
In 3D, it would be similar. You would need to specify a 3D point to rotate around, get the 3D distance and the three angles (x, y, and z angles). Then you increment the angles (in different ways likely) while changing the graphic angles the same way as well.
However, due to Danmakufu's terrible 3D engine, the angles happen to come across a phenomenon called
gimbal locking where it can't rotate in certain angles under certain conditions. Also, Danmakufu only takes integer values for the SetGraphicAngle function, possibly due to a bug. If you put in a float, it will truncate it which means that if you rotate the graphic slowly, it will be jerky.
Sometimes I see percentage signs (%) in scripts. What is it used for? I can't seem to figure this out.
Also, since I'm still very bad at Danmakufu - How would one get a bullet to bounce off walls twice?
% is a math operator called modulus. Basically it divides the first number with the second number and tells you what the remainder is. For example, 17%5 would be 2 because 17/5 is 3 remainder 2.
For your second question, it sounds like you already know how to bounce a bullet off once. Why don't you just get a variable to hold how many times the bullet bounced and if it exceeds however many times you want, then you don't bounce it anymore?