View Single Post
Old 01 June 2016, 10:35   #1
Brick Nash
Prototron
 
Brick Nash's Avatar
 
Join Date: Mar 2015
Location: Glasgow, Scotland
Posts: 413
Amal animation & HREV with joystick commands

Hi folks apologies for the more in depth post but I thought it time to actually post what I'm typing in. There may be a few mistakes as I can't get clipboard sharing to work so I had to copy the code by hand!)

I'm trying out moving my Bob with a joystick now and so far so good but I'm wondering how to go about using the joystick commands like Jup, Jright etc and using them in conjunction with my Amal animation so that it plays while the joystick is activated plus the HREV command to flip the image if Jleft is activated

I can get the animation running but no joystick movement if I place the bob definition and Amal command above the joystick input loop or I can get the joystick to work but no animation (or flipping) when I put the bob definition and Amal command within the joystick loop.


All the joystick commands are in there but here's some examples using just Jleft:

The code below means I can move but the animation doesn't play -

Code:
SX=SX-1

SX=160 : SY=100 : GUY=1

DO
bob 1, SX, SY, GUY
If Jleft(1) and SX>0 Then SX=SX-1

Wait VBL
Loop

Amal 1 "Anim 0, (1,8) etc............."
Amal On
The code below means the animation plays but the joystick won't move the bob -

Code:
SX=SX-1

SX=160 : SY=100 : GUY=1

bob 1, SX, SY, GUY
Amal 1 "Anim 0, (1,8) etc............."
Amal On

DO

If Jleft(1) and SX>0 Then SX=SX-1

Wait VBL
Loop
I've tried placing the Amal commands in a variety of places that seemed sensible including putting the bob definition and Amal command in the lop and putting 'Amal on' after the joystick commands using the colon ( : ) but so far nothing seems to work.

Thanks for the tolerance folks, manuals are a little hard when you have a learning difficulty and sometimes things don't sink in or click right away so I appreciate the tolerance.
Brick Nash is offline  
 
Page generated in 0.05196 seconds with 11 queries