Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: sprite movement  (Read 3794 times)

0 Members and 1 Guest are viewing this topic.

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
sprite movement
« on: September 12, 2005, 11:18:55 AM »

i did a sprite movement in my game and solved it with this code

Code: [Select]
var i = 380;
   while(brief.Y < 424)
  {
  i = i+1;
  brief.SkipTo(405,i);
  Sleep(20);
}

now i have another case, where i want to move and maybe rotate a sprite which is a bit more complicated,
therefore my question:
is the above code the usual way, for sprite movement?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: sprite movement
« Reply #1 on: September 12, 2005, 11:50:00 AM »

It depends on what you need to achieve. Scripting the movement is one way, you can also encode the movement directly into your sprite file (using the MoveX and MoveY fields in SpriteEdit) or you can use an actor instead and move it using the GoTo() method.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: sprite movement
« Reply #2 on: September 20, 2005, 09:18:30 AM »

thanks, i guess i must do it with scripting, cause i need something like this:

scene entity move to 175,430 - rotate 30 deg - move to 430,400 - rotate -45 deg - move to 740,440 - rotate 0deg

but i cant rotate the entity, i tried entity.Rotate(30); and entity.Rotate = 30;  :o , but nothing happens.
can you help me out ??
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: sprite movement
« Reply #3 on: September 20, 2005, 09:28:22 AM »

You will need to make the entity rotatable first:

Code: [Select]
entity.Rotatable = true;
entity.Rotate = 30;
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Rocco

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 87
    • View Profile
    • Virtual-Illusion
Re: sprite movement
« Reply #4 on: September 20, 2005, 09:38:58 AM »

thx a lot works fine,  ;D
your pacing, is amazing
Logged
 

Page created in 0.042 seconds with 21 queries.