Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
Jose

Junior Member
Registered:
Posts: 1
Reply with quote  #1 
I'm trying to create an animation of a ball moving across the screen, but would like to be able to control the position during a trial (through joystick or keyboard inputs, for example). I can't use the set_object_path function as it wouldn't allow my program to respond to changes within a trial, so I tried using the reposition_object within a for loop to try to create an animation. The basic structure of my code is something like

toggle object
idle(100)


for i = 1:totalframes
xpos = nextXPos
ypos = nextYpos 
reposition_object(object, xpos, ypos)
end


I've tried it with and without a short idle period at the end of the for loop and in every case the trial ends by the second iteration of the for loop. Am I doing something wrong? Is the reposition object function simply not meant to work this way? Is there possibly a better way to go about this? 
Thanks.
0
Jaewon

Administrator
Registered:
Posts: 971
Reply with quote  #2 
What is the version of your MonkeyLogic? The information you provided is not complete, but your logic looks valid. In fact, I just added an example task in my new NIMH ML release that does what you said in a similar way you described. You may want to try it.

http://forums.monkeylogic.org/post/nimh-monkeylogic-8118700?pid=1293700817&forum=454793

Another option is to set "Subject cursor image" in the main GUI and add "showcursor('on');" in your timing file when you want to show the joystick cursor.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.