File: sdl-ninja-magic.e

package info (click to toggle)
entity 0.7.2-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,352 kB
  • ctags: 5,272
  • sloc: ansic: 61,707; sh: 7,921; makefile: 732; perl: 399
file content (24 lines) | stat: -rw-r--r-- 668 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<object>
 <timer name="test" interval="10" action="update_window" /> 

 <sdl-window name="test" fullscreen="true" width="1024" height="768">

   <sdl-sprite name="sprite1" src="ninja.bmp" xpos="0" ypos="0" />
 </sdl-window>
  <perl> <![CDATA[
    sub update_window
      {
        my $enode = enode ("sdl-window.test");
        $enode->attrib ("_refresh" => "true");

        $enode = enode ("sdl-sprite.sprite1");
        my $x = $enode->attrib( "xpos");
        my $y = $enode->attrib( "ypos");
        
        $x = rand(1024);
        $y = rand(768);
        $enode->attrib ("xpos" => "$x");
        $enode->attrib ("ypos" => "$y");
      }
  ]]></perl>
</object>