1
Technical forum / Re: controlling scene with mouse
« on: April 09, 2010, 06:44:38 PM »yes true.. i meant something like your example.
Here's a playable scene from my tinkerings with WME. I really dig this engine!
Download here:
http://www.bigmoon.net/leo.zip (about 10M)
Unzip and throw it in a folder with wme.exe
It's still a bit rough around the edges. Who knows, I might even make a whole game.
Oh yeah, it's compiled with build 19 and requires hardware acceleration.
The wme.exe (WME engine runtime) can be downloaded here:
http://www.dead-code.org/download/wme_runtime.zip (400 KB)
#include "scripts\keys.inc"
on "Keypress"
{
if (Scene.CanHandleEvent("Keypress")) Scene.ApplyEvent("Keypress");
if (Keyboard.KeyCode == VK_UP)
{
Scene.SkipTo(Scene.X, Scene.Y-50);
}
else if (Keyboard.KeyCode == VK_DOWN)
{
Scene.SkipTo(Scene.X, Scene.Y+50);
}
else if (Keyboard.KeyCode == VK_LEFT)
{
Scene.SkipTo(Scene.X-50, Scene.Y);
}
else if (Keyboard.KeyCode == VK_RIGHT)
{
Scene.SkipTo(Scene.X+50, Scene.Y);
}
}
#include "scripts\base.inc"
// here comes the stuff which initializes the scene
////////////////////////////////////////////////////////////////////////////////
// scene state
global Statepanoroma;
// default values
if(Statepanoroma==null)
{
Statepanoroma.Visited = false;
// add scene states here
if (Keyboard.KeyCode == "VK_UP")
{
Scene.SkipTo(Scene.X, Scene.Y-50);
}
else if (Keyboard.KeyCode == "VK_DOWN")
{
Scene.SkipTo(Scene.X, Scene.Y+50);
}
else if (Keyboard.KeyCode == "VK_LEFT")
{
Scene.SkipTo(500, 300);//Scene.SkipTo(Scene.X-50, Scene.Y);
}
else if (Keyboard.KeyCode == "VK_RIGHT")
{
Scene.SkipTo(Scene.X+50, Scene.Y);
}
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
////////////////////////////////////////////////////////////////////////////////
if(!Statepanoroma.Visited)
{
Statepanoroma.Visited = true;
// this is our first visit in this scene...
}