Wintermute Engine > Technical forum

The illusion of vehicle movement across the scene (on the X-axis)

<< < (2/4) > >>

Indra Anagram:
Hi eborr!


--- Quote from: eborr on December 02, 2017, 11:48:51 PM ---Not wishing to sound harsh but all you do is to reset the x,y coordinnates for each object within a loop.

--- End quote ---

You don't sound harsh, not at all - maybe a bit sophisticated  :), but that's the question of your experience in scripting compared to mine.

I added this piece of code to scene_init.script:


--- Code: WME Script ---treebg1.X=0;while (treebg1.X<800+512)  {    treebg1.X = treebg1.X+1;    Sleep(1000);  }
However nothing really changed - the treebg1 entity isn't moving anywhere.

Guess the problem is I misunderstand following things:

1. Should background trees be one big entity sprite or separate entities?
2. How exactly do I move the tree entities along the x-axis? What method or command should be used?


--- Quote from: eborr on December 02, 2017, 11:48:51 PM ---You set this up as a script you can call, and invokr it for the duration.

--- End quote ---

3. I am sorry, could you please provide more details?


--- Quote from: eborr on December 02, 2017, 11:48:51 PM ---If you want to see this in action look at the cars in the background in the K'NOSSOS tutorial.

--- End quote ---

4. Where could I read or download the tutorial to see the cars in the background?

THANK YOU, eborr!

eborr:
you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen

to get the KNOSSOS demo

www.svarunentertainment.com

also on itchio and gog - but I don't have the links

Indra Anagram:

--- Quote from: eborr on December 03, 2017, 02:41:01 PM ---you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen

--- End quote ---

Hey eborr, you did this! The tree runs across the scene behind the car sprite  ;D

However, I had to disable car entity animation (that imitated its movement) in this line


--- Code: WME Script ---car.PlayAnim("entities\car\sprites\move.sprite"); //Set the car in motion
because otherwise your code wouldn't cause the tree entity move.

1. Is that possible to keep both the car entity animation and your script running?
2. Also the tree entity only moved to the right once. How do we cause it return to the initial position and repeat its path across the scene? How do we stop this behavior at a given moment?


--- Quote from: eborr on December 03, 2017, 02:41:01 PM ---to get the KNOSSOS demo

www.svarunentertainment.com

--- End quote ---

I will download and try the demo, eborr.

THANK YOU for your kind attention and help!

Indra Anagram:

--- Quote from: eborr on December 03, 2017, 02:41:01 PM ---you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen

--- End quote ---

eborr, I am sorry for asking you about the car entity animation. Have just solved this by setting move.sprite in car.entity by default  :) .

Anyway I don't know how it is possible to make the tree entity appear at its initial position over and over again once your script has run (like in this screen)



and how to make this stop at a given moment. Should the script be modified? Or is it another script?

THANK YOU, eborr!

Indra Anagram:
Dear Muties! Still need your help with the scene. eborr's code works fine, yet I tried to set it to repeat numerous times and... nothing.

How is it possible to make an entity (such as treebg1) move across the scene over and over again?

THANK YOU for your attention and help!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version