English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 05 June 2016, 21:13   #1
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
Bob jitter with diagonal movement

Hi just a small quick question before I settle down for the night. I'm moving my player using the old X=X+3 for right and Y=Y=3 for up etc.

Works fine but when I push diagonally up and right it jitters (same with all diagonal directions). I think it's because I'm going through the main loop and it's seeing the condition for Go Right and then the condition for Go Left and doing them one at a time in sequence instead of together.

It didn't happen before but I'm not sure what I changed to cause it.
Brick Nash is offline  
Old 05 June 2016, 22:57   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Don't forget the state idea from the other thread. Do a different state for each direction. One advantage of a state variable is that you can do hidden sequences of moves to make super attacks and combos.
Samurai_Crow is offline  
Old 05 June 2016, 23:54   #3
alkis
Registered User
 
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
Unlikely, but it could also be explained by the change of speed magnitude. You have 3 in x and y for speed, but you go to 4.24 (sqrt(vx^2+vy^2) = sqrt(3^2+3^2) = sqrt(18) = 4.2426).

The right vx/vy for a diagonal of the same magnitude is 2.1213
alkis is offline  
Old 06 June 2016, 10:52   #4
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 411
I managed to sort it thanks to Volvo_one who's been a great help s has everyone.

Quote:
Originally Posted by Samurai_Crow View Post
Don't forget the state idea from the other thread. Do a different state for each direction. One advantage of a state variable is that you can do hidden sequences of moves to make super attacks and combos.
Yes I'm interested in that. I uses states in Game Maker and they're so handy but I'm still unsure how to go about that in Amos as I think I've been trying something similar but with subroutines which doesn't really work as the subroutine is read once then goes back to the main loop.

I think you mentioned that I make a custom variable of some sorts?
Brick Nash is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Diagonal Lines on TV eva support.Hardware 7 24 April 2015 13:38
Bob's Bad Day - ... no Bob. AB Positive support.Games 5 16 May 2009 01:45
How do I map a diagonal left/right for a key in CD32 Emulation? HyperBolt support.WinUAE 1 10 June 2006 23:12
Joysticks with the faulty diagonal syndrom StarEye support.Hardware 1 05 July 2005 13:38
Jerky mouse movement andreas support.WinUAE 3 02 June 2002 19:14

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


All times are GMT +2. The time now is 13:59.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06540 seconds with 15 queries