April 18, 2024, 05:27:20 AM
Welcome,
Guest
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
For WME related articles and tutorials visit
WME Resource Center
.
Home
Help
Search
Calendar
Login
Register
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Moving object
« previous
next »
Pages: [
1
]
Print
Author
Topic: Moving object (Read 3710 times)
0 Members and 1 Guest are viewing this topic.
coderMan
Lurker
Karma: 0
Offline
Posts: 3
Day Programmer Night Coder
Moving object
«
on:
September 29, 2011, 08:42:06 PM »
Hello to all, i am new to scripting and i would like to get some help,here is what i want to do :
A 2d square in the screen that moves on x axis to left and right by the control of player, and also not moves off the screen, Another 2d square that falls towards the ground from the top of the screen. if anyone care to help me i would be thankful. good luck.
«
Last Edit: September 29, 2011, 09:09:55 PM by coderMan
»
Logged
keybone
Regular poster
Karma: 0
Offline
Posts: 112
Re: Moving object
«
Reply #1 on:
September 30, 2011, 12:54:58 PM »
I done it in in this way:
#include "scripts\base.inc"
var Vcube = Scene.GetNode("Name Sprite of the 2d in editor of the cube"); //sprite 2d
on "Keypress"
{
while(Keyboard.IsKeyDown(VK_RIGHT))
{
Vcube.X= 20 ; //pos on x
Sleep(10);
}
while(Keyboard.IsKeyDown(VK_LEFT))
{
Vcube.X= -20 ; //pos on -x
Sleep(10);
}
}
I'm not sure it works, it should go. Unfortunately I am not a great programmer.
Logged
Lucine Company
http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark
http://www.lucine.it/TalesOfLucine
coderMan
Lurker
Karma: 0
Offline
Posts: 3
Day Programmer Night Coder
Re: Moving object
«
Reply #2 on:
September 30, 2011, 03:01:00 PM »
Hello my friend, this will be a reference for me, i will use it now , thanks alot,goodluck.
Logged
Mnemonic
WME developer
Administrator
Addicted to WME forum
Karma: 41
Offline
Gender:
Posts: 5683
Re: Moving object
«
Reply #3 on:
October 01, 2011, 08:49:34 AM »
coderMan: If you need more help, just say it. There's no need to send me private messages with the same question (see my signature) or register a new account to ask again.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum.
Print
Pages: [
1
]
« previous
next »
Wintermute Engine Forum
>
Wintermute Engine
>
Technical forum
>
Topic:
Moving object