object motion and bouncing
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



object motion and bouncing Expand / Collapse
Author
Message
Posted 1/14/2008 5:13:31 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/16/2008 10:26:20 PM
Posts: 4, Visits: 30
Recently, I am conducting an inattetional blindness experiment, but I have no idea on how to write the script to make object move in the screen.

The procedure is expected as following:

There are several shapes or letters, move randomly in the screen, bounce the edge sometimes. During the movement, there is additional object move in and out. Participants need to count the bouncing time, and report whether they see the additional object.

Please give me some hint, or example. Thank you very much.

Post #1096
Posted 1/15/2008 2:29:50 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: Today @ 4:36:34 PM
Posts: 129, Visits: 927
Hello,

I have attached a few of the sample experiments available on our web support site that demonstrate how to have various shapes on the screen move. If you have any questions, please let me know.


- Matt
PST Technical Consultant
http://pstnet.com


  Post Attachments 
SpriteAnimation.zip (15 views, 65.82 KB)
AnimateCanvas.zip (15 views, 3.02 KB)
Post #1111
Posted 1/16/2008 2:05:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/16/2008 10:26:20 PM
Posts: 4, Visits: 30
Thank you very much! With your samples, I am able to display the motion.

But still there are some problems:

1. I do not understand the code of "SourceColorKey", and I do not know how to realize transparency. When two object overlap, the frame of the picture is apparant

2. How to record the times of bouncing, since everytime the object bounce the edge of the display.

3. How to make the cross move from the right to the left and then disappear, how to present the gradually moving in and out.

Attached is my script. Please give me another hint, Thank you again.

  Post Attachments 
IB.rar (2 views, 5.84 KB)

Post #1116
Posted 1/16/2008 12:05:05 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: Today @ 4:36:34 PM
Posts: 129, Visits: 927
Hello,

1) The SourceColorKey property specifies the color that you want E-Prime to ignore when displaying the object. So, if you specify a SourceColorKey of "black", all parts of the image that match the SourceColorKey will appear transparent. It appears that your images have a gray area that would apply to this. You would need to determine the RGB value of the gray color you are using and assign it to the SourceColorKey so that it is ignored by E-Prime and appears transparent.

2) You can use the E-Prime Clock object to log timestamps of when the objects "bounced" against the edge of the screen. The Clock.Read function will return to the current value of the clock. For example, if your script determines a "bounce" has occurred, you could use:

c.SetAttrib "BounceTime", Clock.Read

This script will log the clock time as an attribute in the data file under the column "BounceTime".

3) The best advice I can offer here is to look into the Canvas and Slide topics in the E-Basic Online Help (accessed via the Help menu in E-Studio). This will help you become familiar with the various commands you will be using. Note that to have the image move in and out (e.g. "looming"), you may need to use the Slide object.


- Matt
PST Technical Consultant
http://pstnet.com
Post #1127
Posted 1/17/2008 3:13:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/16/2008 10:26:20 PM
Posts: 4, Visits: 30
Thanks for your quick reply! With your help, my programming is closed to end.

But here are still two more questions

1. Since I used a smaller frame to present stimulus, how can I set the outside color as black, or say can I set the Display's color? I find Display.backcolor does not work

2. The second one is odd, I use "rcDest.right = edge" to record the bounce, but I can only record some. I can not record rcDest4 and so on. Could you please help me to find the solution? Is there any other method to track the position of the picture?

Thank you very much! I am sorry to bother you again

  Post Attachments 
IB2.rar (5 views, 6.22 KB)

Post #1130
Posted 10/21/2008 6:20:17 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/21/2008 6:58:36 PM
Posts: 1, Visits: 4
Hi there,

I wonder if you could finally manage to finish your programming. I'm very interested, as I need more or less the same kind of display but instead a cross moving from left to right, I need a rectange appearing in the center of the screen for 1.5 seconds. Could you please help me with that?

Thank you very much,
Judit.
Post #2320
« Prev Topic | Next Topic »


Permissions Expand / Collapse