﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 3  » pacman task</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 12 Sep 2026 22:30:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: pacman task</title><link>https://forums.millisecond.com/Topic6017.aspx</link><description>&lt;p&gt;Thanks for your response. This programming is more straightforward indeed.&lt;/p&gt;
&lt;p&gt;Still sometimes it doesn't respond on the presses, so if anyone has an idea on that, please let me know.&lt;/p&gt;
&lt;p&gt;I'm now trying to program some 'detection-part', that is when two figures collide when moving (e.g. pacman catches a ghost or vice versa).&lt;/p&gt;</description><pubDate>Mon, 02 May 2011 05:39:49 GMT</pubDate><dc:creator>m.hengstler</dc:creator></item><item><title>RE: pacman task</title><link>https://forums.millisecond.com/Topic6014.aspx</link><description>&lt;p&gt;[quote]However, on some occasions the pacman doesn't respond to the key press, presumably because it was made at exactly a loop-point.[/quote]&lt;/p&gt;
&lt;p&gt;You probably won't be able to avoid this completely, however with the right timing, these occasions should be rare.&lt;/p&gt;
&lt;p&gt;[quote]So, my question would be: Is there a way that a pacman-figure is moving on its own, and a participant can intervene this movement by changing directions via key presses?[/quote]&lt;/p&gt;
&lt;p&gt;You'll want to do something like this:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;defaults&amp;gt;&lt;br /&gt;/ windowsize = (800px, 600px)&lt;br /&gt;&amp;lt;/defaults&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ h = 50%&lt;br /&gt;/ v = 50%&lt;br /&gt;/ step = 2%&lt;br /&gt;/ direction = 205&lt;br /&gt;&amp;lt;/values&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;shape mydot&amp;gt;&lt;br /&gt;/ shape = circle&lt;br /&gt;/ size = (25px,25px)&lt;br /&gt;/ hposition = values.h&lt;br /&gt;/ vposition = values.v&lt;br /&gt;/ color = (white)&lt;br /&gt;/ erase = false&lt;br /&gt;&amp;lt;/shape&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;shape mybackground&amp;gt;&lt;br /&gt;/ shape = rectangle&lt;br /&gt;/ size = (100%,100%)&lt;br /&gt;/ color = (black)&lt;br /&gt;/ erase = false&lt;br /&gt;&amp;lt;/shape&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial mytrial&amp;gt;&lt;br /&gt;/ ontrialend = [if(trial.mytrial.response!=0)values.direction=trial.mytrial.response]&lt;br /&gt;/ ontrialend = [if(values.direction==200)values.v=values.v-values.step]&lt;br /&gt;/ ontrialend = [if(values.direction==208)values.v=values.v+values.step]&lt;br /&gt;/ ontrialend = [if(values.direction==205)values.h=values.h+values.step]&lt;br /&gt;/ ontrialend = [if(values.direction==203)values.h=values.h-values.step]&lt;br /&gt;/ ontrialend = [if(values.h&amp;lt;0)values.h=100%]&lt;br /&gt;/ ontrialend = [if(values.h&amp;gt;100%)values.h=0%]&lt;br /&gt;/ ontrialend = [if(values.v&amp;lt;0)values.v=100%]&lt;br /&gt;/ ontrialend = [if(values.v&amp;gt;100%)values.v=0%]&lt;br /&gt;/ stimulusframes = [1=mybackground, mydot]&lt;br /&gt;/ validresponse = (0,200,203,205,208)&lt;br /&gt;/ trialduration = 300&lt;br /&gt;/ branch = [trial.mytrial]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;block myblock&amp;gt;&lt;br /&gt;/ trials = [1=mytrial]&lt;br /&gt;&amp;lt;/block&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Mon, 02 May 2011 05:21:47 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>pacman task</title><link>https://forums.millisecond.com/Topic6013.aspx</link><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I'm trying to program a pacman-like task in Inquisit.&lt;/p&gt;
&lt;p&gt;The first thing I would like to get to work is that Inquisit responds to key presses of the participants. So if a participants decides to go left (ie press left arrow) the pacman would turn left. If no response has been made by the participant, the pacman-figure should move in the way it was going. So, in short, a partipants controls the direction in which the figure is going, and the figure itself is moving by itself.&lt;/p&gt;
&lt;p&gt;I already managed to let the pacman move by itself, and I also managed to program that it responds to the key presses. However, on some occasions the pacman doesn't respond to the key press, presumably because it was made at exactly a loop-point. So basically it works, only that sometimes the pacman doesn't respond.&lt;/p&gt;
&lt;p&gt;So, my question would be: Is there a way that a pacman-figure is moving on its own, and a participant can intervene this movement by changing directions via key presses?&lt;/p&gt;

&lt;p&gt;Thanks in advance,&lt;/p&gt;
&lt;p&gt;Maikel&lt;/p&gt;

&lt;p&gt;PS: I've attached the script and figures.&lt;/p&gt;</description><pubDate>Mon, 02 May 2011 04:18:49 GMT</pubDate><dc:creator>m.hengstler</dc:creator></item></channel></rss>