PDA

View Full Version : Help me please...


miogi
10-17-2006, 09:39 PM
:confused:

I am recently new at Alice and I am trying to make an object, such as a plane start off by slowly starting the propellors and then gradually increasing them to make it realistic. I know I have to use increaments, but I dont know how to find the increament command and also, I am confused because I have to make this plane fly around a centre point and when it is doing it, it has to bank slightly. I think I have to use a while, and I need to use a loop, but I have been on this for sometime and I am just getting more and more frustrated.. Any help to this newbie would be very much appreciated..

Miogi

DrJim
10-17-2006, 10:50 PM
From your description, your problem could be fairly easy to moderately hard. A few hints:

In the style menu, which is available with most instructions by clicking on "more", there are gently, start gently, end gently and and abrupt options. If you use the start gently option with a turn (or roll, if you are using the gallery biplane) command, the movement will start slowly and speed up automatically.

The only increment commands I have used are with the loop command (I think I've gotten rhe option elsewhere but can't find it or a reference - help anyone? :confused: ). Use the "show complicated options" version to see the full command - then use it with more roll commands or the roll at speed command to build up speed. The loop index will be available as an expression in the appropriate pull down menus.

Note here you are going to run into a display limit since typically the display will run around 10 frames per second so you aren't going to display any more propeller images than that - as a result your prop might even reverse direction. :eek: Try several options to see what you like the best - the appearanc can differ depending on size, background, etc.

As for circling an object, this can be done by a set -- as vehicle option and is covered in both texts (page 108 in Dunn, et al for example) and other posts in this forum. Set your bank before you start the circle and you should be OK.

Don't see, from your brief description why you would need a while command.

miogi
11-01-2006, 06:13 PM
thanks buddy for your help...
if its not asking too much, I was wondering if I could ask you another question please..

I am working on a new asignment for School and I am having a little trouble with colision detect and making the wheels turn while I turn left/right and make them come back to thier original position.
I have to make a car go through a world with lots objects and make the keyboaord commands to go forward, back, rt and left. I am having a slight difficulty in getting the tires on front to turn and come back to normal position when turnng rt/lt. Also, when the carhits an object, it has to have a colision detect and the program stops..

Any hints or help would be very much appreciated..

Thanks, Miogi

DrJim
11-02-2006, 10:55 AM
Not sure how much I can help - probably very little on the second question. Hopefully some others will also add comments :) .

For the first, the problem may be that you are trying to turn the wheels when they are also rolling - this is going to mess up the coordinate reference for the wheels. Try turning the wheels "--- as seen by the car body" or something similar. Then, as long as you turn back straight the same amount as you turned right or left you should be OK.

I'm no help on the second except for the obvious - that you need to use a proximity function. I know others have worked on the problem - if you do a search of the forum for "collision" you probably can find some things that will help.

roofy
11-03-2006, 02:25 PM
Hi there miogi,
What I would do first is start with the foundation. Fisrt think about what instructions you will need for the front wheels to turn only in one direction without having the wheels straigntening out. For example, you will need a key press event, and a method instruction that will turn the front wheels in one direction x amount of revolutions, while keeping the x amount of revolutions very small such as 0.02.

Also seeing that you said you are doing this for class, and unless you have learned about global variables, I would not recommend going any further then my above example. I say this because from previous experiences of myself learning about global variables, back when there was no such thing as Alice, global variables can be a complicated thing to learn. However, if you are willing to give it a shot, and you have the book "Learning to Program With Alice", there is a chapter that explains about global variables and uses a car demo as an example which includes instructions for turning the front wheels left and right.

Shadow Sovereign
11-07-2006, 03:31 PM
If you're using the disc version of Alice, you should have some examples in your file directory. Try looking at the Flight Simulator example, where you fly a Biplane through some rings. I have noticed that the program fades out and puts you back up in the sky if you 'hit' the ground, and the code for that should help you with your collision detection problem. :cool:

I'm all about looking at other pieces of work to help me along with a problem, so if you have any future problems, try doing that. It's a good strategy, believe me! :D