Difference between revisions of "Meta:Samples/Software"

From TSG Doc
Jump to navigation Jump to search
Line 35: Line 35:
  
 
<syntaxhighlight lang="html4strict" line>
 
<syntaxhighlight lang="html4strict" line>
<!DOCTYPE html>
+
#!/usr/bin/env python
<html lang="en">
 
<head>
 
    <meta charset="UTF-8">
 
    <title>Sky Islands v0.2</title>
 
    <meta name="description" content="">
 
    <meta name="viewport" content="width=device-width">
 
    <link rel="stylesheet" href="css/main.css">
 
</head>
 
  
<body>
+
# import psychopy and rusocsci
  <div id="container">
+
from psychopy import core, visual
      <div id="game-wrapper">
+
from rusocsci import buttonbox
          <div id="game-canvas-wrapper"></div>
 
          <div id="game-gui"></div>
 
          <div id="game-dialog"></div>
 
          <div id="game-playerstats">
 
              <div id="player-avatar-container"><img id="player-avatar" src="res/avatar/f001.png" /></div>
 
              <div id="player-stats">
 
                  <div id="player-resources">
 
                      <ul>
 
                          <li id="player-resource1" class="player-resource">0</li>
 
                      </ul>
 
                  </div>
 
                  <div id="player-name">
 
                      <p id="player-name-tag"></p>
 
                  </div>
 
              </div>
 
          </div>
 
          <div id="game-powers">
 
              <div id="power1" class="power"></div>
 
              <div id="power2" class="power"></div>
 
          </div>
 
          <div id="game-menu">
 
              <div id="menu-start" class="menu-full">
 
                  <div id="start-buttons">
 
                      <ul>
 
                          <li id="start-button-start" onclick="onStart()">New Game</li>
 
                      </ul>
 
                  </div>
 
              </div>
 
              <div id="menu-avatar-select" class="menu-ingame">
 
                  <div id="avatar-selector">
 
                      <p>Select Avatar</p>
 
                      <div class="avatar-menu" onclick="onAvatar(0)"><img src="res/avatar/f001.png" /></div>
 
                      <div class="avatar-menu" onclick="onAvatar(1)"><img src="res/avatar/m001.png" /></div>
 
                  </div>
 
                  <div id="avatar-form-container">
 
                    <p>Enter Name</p>
 
                      <form>
 
                          <input type="text" id="menu-name-input" />
 
                          <br/><br/>
 
                          <input type="button" id="menu-name-submit" value="Continue" onclick="onAvatarSelect()" />
 
                      </form>
 
                  </div>
 
              </div>
 
              <div id="menu-level-select" class="menu-ingame">
 
                  <ul>
 
                      <li id="menu-level-1" class="menu-level-unlocked" onclick="onLevelSelect(1)">Level 1</li>
 
                      <li id="menu-level-2" class="menu-level-locked">???</li>
 
                      <li id="menu-level-3" class="menu-level-locked">???</li>
 
                      <li id="menu-level-4" class="menu-level-locked">???</li>
 
                  </ul>
 
              </div>
 
              <div id="menu-gameover" class="menu-ingame">
 
                  <p>Oh no! You have lost an island!</p>
 
  
                  <p><a onclick="onRetry()">Try Again</a></p>
+
## Setup Section
                  <p><a onclick="onBackToMenu()">Back to Menu</a></p>
+
win = visual.Window(monitor="testMonitor")
              </div>
+
bb = buttonbox.Buttonbox()
              <div id="menu-win" class="menu-ingame">
+
text = visual.TextStim(win, "Press a button on the buttonbox")
                  <p>Congratulations! You are awesome!</p>
 
                  <p><a onclick="onRetry()">Play Again</a></p>
 
                  <p><a onclick="onBackToMenu()">Next Level</a></p>
 
                  </div>
 
              <div id="menu-timeup" class="menu-full">Je bent nu klaar met dit onderdeel. Ga naar het volgende onderdeel door dit pop-up venster te sluiten, door middel van het rode kruisje.</div>
 
              <div id="menu-tutorial" class="menu-full">
 
                  <div id="menu-tutorial-button">
 
                      <p onclick="pause()">Continue</p>
 
                  </div>
 
              </div>
 
              <div id="menu-pause-button" onclick="pause()"><p>||</p></div>
 
          </div>
 
 
 
          <div id="debug">Version 0.2.3.2</div>
 
 
 
      </div>
 
  </div>
 
 
 
  <script type="text/javascript" src="js/resources.min.js"></script>
 
  <script type="text/javascript" src="js/sprite.min.js"></script>
 
  <script type="text/javascript" src="js/game.min.js"></script>
 
</body>
 
</html>
 
  
 +
## Experiment Section
 +
# show text
 +
text.draw()
 +
win.flip()
 +
# wait for response
 +
b = bb.waitButtons()
 +
# show response
 +
text.setText("you pressed: {}".format(b))
 +
text.draw()
 +
win.flip()
 +
core.wait(5)
  
 +
## Cleanup Section
 +
core.quit()
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Revision as of 11:45, 28 April 2015

Introduction.


Features

This software is made to do this, it has these unique selling points:

  • Feature 1[1]
  • Feature 2
  • Feature 3

Requirements

  • Microsoft Windows XP or later.
  • Intel Core 2 Duo E8600 or higher.
  • Python


Installation

Windows 7 64-bit

  1. Step 1
  2. Step 2
  3. Step 3


Configuration

General settings.


Usage

Templates and how-to's go here.


Template

 1#!/usr/bin/env python
 2
 3# import psychopy and rusocsci
 4from psychopy import core, visual 
 5from rusocsci import buttonbox
 6
 7## Setup Section
 8win = visual.Window(monitor="testMonitor")
 9bb = buttonbox.Buttonbox()
10text = visual.TextStim(win, "Press a button on the buttonbox")
11
12## Experiment Section
13# show text
14text.draw()
15win.flip()
16# wait for response
17b = bb.waitButtons()
18# show response
19text.setText("you pressed: {}".format(b))
20text.draw()
21win.flip()
22core.wait(5)
23
24## Cleanup Section
25core.quit()

See Also


References

  1. Some reference