| Posted By | Message | 
	
	
		|  spliffy
 
   
 Registered
 18/11/2006
 Points
 22
 | 
  			5th December, 2008 at 13:15:45 - 
  		
			
		
  			
  		 i have a volley ball that i want to bounce for alt value b (which is y position)*2/3 when it hits the ground and ive tried everything but cant get it to work, whats the expression im looking for?
 
 
  n/a | 
  	
  	
		|  Willy C
 
   
 Registered
 14/02/2004
 Points
 1524
 
 
           
    | 
  			5th December, 2008 at 14:53:25 -
  		
			
		
  			
  		 What do you want to happen?
 Do you want to post your code?
 
 I have never tried it, but there should be a pinball movement in MMF2/TGF2, maybe that would be easier to use.
 
 Also you can try this: "When ball hits ground, set direction to current direction + 16"
 That will make it go in a opposite direction.
 
 
  http://www.robocaptain.com | 
  	
  	
  	
  	
		|  spliffy
 
   
 Registered
 18/11/2006
 Points
 22
 | 
  			5th December, 2008 at 15:54:43 -
  		
			
		
  			
  		 i want the ball to bounce and lose some strenght each time it hits the floor untill it comes to a stop
 
 always - set ball y pos to ball y pos + alt value B
 
 ball y pos > 500 - set alt value B of ball to alt value B of ball * 2/3
 
 
  Edited by spliffy 
 
  n/a | 
  	
  	
  	
  	
		|  Matt Boothman
 The Nissan Micra of forum members
 
 Registered
 20/09/2002
 Points
 109
 
 
   | 
  			5th December, 2008 at 16:05:48 -
  		
			
		
  			
  		 You sure the "Ball Y Pos > 500" is correct? The code seems fine, so it might be the actual event that's not being triggered.
 
 
  http://soundcloud.com/normbo  - Listen to my music. | 
  	
  	
  	
  	
		|  spliffy
 
   
 Registered
 18/11/2006
 Points
 22
 | 
  			5th December, 2008 at 16:35:20 -
  		
			
		
  			
  		 the code is wrong because when i test it i use
 
 
 pushing control button - set alt value B of ball to alt value B of ball * 2/3
 
 
  n/a | 
  	
  	
  	
  	
		|  -J-
 
   
 Registered
 05/10/2008
 Points
 228
 
 
    | 
  			5th December, 2008 at 23:24:06 -
  		
			
		
  			
  		 Dividing alt value B by two thirds would most always result in a number with decimals. I dunno, maybe you'd have to "floor" or "ceil" it like this:
 
 always - set ball y position to: ball y position + Floor(alt value B)
 
 or
 
 ball y position > 50 - set alt value B of ball to: Floor(Alt value B of ball * 2/3)
 
 
 I have no idea if that would help, the only reason I thought this was that you can't move an object something like 300.33333333333333333333333333333333...       pixels, it might have to be a whole number :S
 
 
  n/a            ... | 
  	
  	
  	
  	
		|  Cecilectomy
 noPE
 
 Registered
 19/03/2005
 Points
 305
 
 
           
   | 
  			5th December, 2008 at 23:43:56 -
  		
			
		
  			
  		 if any one saw my post i was way off. im tired. but i have a few ideas.
 
 you need to post what you have so far in some form or another so we know where youre going with this.
 
 
  Edited by Cecilectomy 
 
  n/a | 
  	
  	
  	
  	
		|  RedEnchilada
 formerly RedEchidna
 
 Registered
 01/08/2008
 Points
 301
 
 
      | 
  			6th December, 2008 at 15:08:19 -
  		
			
		
  			
  		 Use * -2 / 3. That should work.
 
 
  http://www.youtube.com/watch?v=WYrSD35vHo4 woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan
 | 
  	
  	
		
			|  |  |