Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <game>
- <head>
- <title>Pong</title>
- <screen width="1280" height="720" background="color.black" fullscreen="false" />
- </head>
- <body>
- <variables>
- <variable name="margin" value="30" />
- <variable name="radius" value="20" />
- <variable name="width" value="30" />
- <variable name="height" value="150" />
- </variables>
- <objects>
- <object name="logo">
- <sprite src="shape.circle(radius)" />
- <position x="screen.width.center" y="screen.height.center" />
- <velocity x="0" y="0" />
- <actions>
- <action start="state.playing" />
- </actions>
- </object>
- <object name="ball">
- <sprite src="shape.circle(radius)" />
- <position x="screen.width.center - radius" y="screen.height.center - radius" />
- <velocity x="random.range(-10,10)" y="random.range(-5,5)" />
- </object>
- <object name="paddle1">
- <sprite src="shape.rectangle(width,height)" />
- <position x="screen.left + margin" y="screen.height.center - height / 2" />
- <velocity x="0" y="0" />
- <collision enabled="true" />
- <actions>
- <action name="up" value="move.up(2)" />
- <action name="down" value="move.down(2)" />
- </actions>
- </object>
- <object name="paddle2">
- <sprite src="shape.rectangle(width,height)" />
- <position x="screen.right - margin - width" y="screen.height.center - height / 2" />
- <velocity x="0" y="0" />
- <collision enabled="true" />
- <actions>
- <action name="up" value="move.up(2)" />
- <action name="down" value="move.down(2)" />
- </actions>
- </object>
- </objects>
- <states>
- <state name="mainmenu">
- <show object="logo" />
- <inputs>
- <input action="logo.action.start" button="enter" />
- </inputs>
- </state>
- <state name="settings">
- <show object="logo" />
- <inputs>
- <input action="game.unpause" button="escape" />
- </inputs>
- </state>
- <state name="playing">
- <show object="ball" />
- <show object="paddle1" />
- <show object="paddle2" />
- <inputs>
- <input action="paddle1.action.up" button="q" />
- <input action="paddle1.action.down" button="z" />
- <input action="paddle2.action.up" button="up" />
- <input action="paddle2.action.down" button="down" />
- </inputs>
- </state>
- <state name="paused">
- <show object="logo" />
- <inputs>
- <input action="game.start" button="spacebar" />
- </inputs>
- </state>
- </states>
- </body>
- </game>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement