Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do i make speed controls for a plane?
Old
brucedhammer
Guest
 
Status:
Posts: n/a
Question How do i make speed controls for a plane? - 09-15-2008, 09:13 AM

How do i make speed controls for a plane? Using one buttun to increase the speed and the other to decrease the speed.
   
Reply With Quote
try this
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Talking try this - 09-15-2008, 05:59 PM

i recently added this on my game so i will explain it to you...

first, add 3 variables either in the world properties or on the plane properties, top speed, slow speed, and plane speed...

next make a method in a infinite loop (plane move forward at (plane speed))

next add 2 WHEN A KEY IS TYPED events and change those to WHILE KEY IS PRESSED

for the first event, put in the key u want to use to accelerate, and put in the DURING this

IF (plane plane speed is less than top speed)
increment (plane speed) by 1 , at duration (acceleration speed)(i put 0.25)


for the second event put the key you want to use to slow down and put in the DURING:

IF (plane plane speed is bigger than slow speed)
decrement (plane speed) by 1 , at duration (acceleration speed)(i put 0.25 again)

and that should work!

rick


im back!!! FINNALY!!! got windows working on my mac again!!!
   
Reply With Quote
Thanks
Old
brucedhammer
Guest
 
Status:
Posts: n/a
Default Thanks - 09-17-2008, 10:20 AM

Thanks that helped out. Good Luck
   
Reply With Quote
confused
Old
twopointohaliceuser
Guest
 
Status:
Posts: n/a
Question confused - 11-07-2008, 04:36 PM

Can you show this in picture? I can't seem to get During if part...
   
Reply With Quote
Easy...
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Post Easy... - 11-10-2008, 09:00 PM

To get a while button is pressed trigger, go through the following steps:
  1. Click "create new event" in the "events" box.
  2. In the drop down menu, click "when a key is typed".
  3. When the trigger appears, right click on it and roll over "change to", then click "While a key is pressed".
  4. If you want something to happen one when the touch is started, put it under "begin". If you want it to happen over and over again while the button is pressed, put it under "during". Put anything you want to happen upon release of the button under "end".
The code should look something like this for speed up and speed down (Events box):
Code:
While [1] is pressed
Begin: [NONE]
During: [World.speed down]
End: [NONE]
Code:
 While [2] is pressed
Begin: [NONE]
During: [World.speed up]
End: [NONE]


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Still confused...
Old
twopointohaliceuser
Guest
 
Status:
Posts: n/a
Question Still confused... - 11-28-2008, 09:33 PM

What is World.speed down? What do I put there?
   
Reply With Quote
Reply

Tags
plane, speed controls


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.