creating an oscillating bar using an inline element
BeckyL
lundwall.becky at gmail.com
Tue Jan 31 13:25:42 UTC 2012
Thank you both for your willingness to help. I'll work on this this
morning and update the group on the results as soon as possible. Just
so you know, the problem with the movie option is that E-prime tends
to crash when you use movies and have a Windows 7 or Vista operating
system -- and we are still trying to verify that we have enough
computers with XP at the remote testing site.
On Jan 30, 6:55 pm, lml1... at gmail.com wrote:
> Another option. Create an animation in Final Cut save as an .avi file and run as a movie. Much easier for placement on the screen.
> Sent from my Verizon Wireless BlackBerry
>
>
>
>
>
>
>
> -----Original Message-----
> From: "Vinson, David" <d.vin... at ucl.ac.uk>
>
> Sender: e-prime at googlegroups.com
> Date: Sun, 29 Jan 2012 12:58:58
> To: e-prime at googlegroups.com<e-prime at googlegroups.com>
> Reply-To: e-prime at googlegroups.com
> Subject: RE: creating an oscillating bar using an inline element
>
> Hi BeckyL,
>
> It looks like your main assumption is correct - holding y1 constant rather than varying it along with x1 should produce horizontal motion in the Simple Animation example. If it works on the first trial it's not a complete failure but may have something to do with changes in values from one trial to the next.
>
> My guess is that there's something amiss with your treatment of y1 outside of the assignment to a constant value. Perhaps the exit condition is never met: as in the code below, y1 will never reach 30 if you get rid of (y1 = y1 - 1). So it will run fine, until x1 reaches the edge of the screen in which case it will either crash (display of negative values for x may break it) or hang (because it is no longer drawing anything visible). If this is the case, changing the exit condition so it's based on the value of x1 should sort things out.
>
> another possibility is the assignment of values to y1. Check to make sure that indeed y1 is assigned the value you want, and that this value persists across trials. The simplest way to test this out is to set the value of y1 immediately before the loop (although this is not good programming practice, it's a clear way to be sure that y1 has the desired value).
>
> In cases like these I find it's useful to employ the debug.print function as part of the inline code - for example here displaying the value of x1,y1 to the output window while the experiment is running.
>
> hope this helps!
> david
> ________________________________________
> From: e-prime at googlegroups.com [e-prime at googlegroups.com] on behalf of BeckyL [lundwall.be... at gmail.com]
> Sent: 27 January 2012 18:59
> To: E-Prime
> Subject: creating an oscillating bar using an inline element
>
> I am trying to use the pstnet a modification of the sample "Simple
> Animation/Apparent Motion Example" and to create a new task. I have EP
> 2 and am using Windows XP. I have tried using the E-prime Reference
> Guide and Online E-Basic help but they are not specific enough to
> solve the problem below with my code. I am having trouble getting the
> line to move horizontally instead of diagonally up and right
> (eventually I want it to oscillate in place instead of move off the
> screen, but that is another step).
>
> ORIGINAL CODE
>
> 'Loop continuously until the lines are off screen.
> Do Until y1 = 30
>
> 'Increment and decrement coordinates.
> x1 = x1 + 1
>
> y1 = y1 - 1
>
> 'Wait until the screen refreshes to avoid partial displays.
> Display.WaitForVerticalBlank
>
> 'Clear the screen and draw the new lines.
> cnvs.Clear
>
> cnvs.Line x1, y1, x1, y1 + lineLen
>
> Loop
>
> Logically, it seems that the next step would be to specify that x1 =
> x1 + 1 but y1 remain at 50 (or that y1 = y1). This works for the first
> trial but crashes for the second trial.
>
> Could someone please give more guidance on specifying coordinates for
> movement? Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups "E-Prime" group.
> To post to this group, send email to e-prime at googlegroups.com.
> To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/e-prime?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "E-Prime" group.
> To post to this group, send email to e-prime at googlegroups.com.
> To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/e-prime?hl=en.
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list