Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Sky scrolling  (Read 6258 times)

0 Members and 1 Guest are viewing this topic.

Musta Kaapu

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 55
  • "I'm a bunny rabbit!"
    • View Profile
    • SomethingAwful
Sky scrolling
« on: May 09, 2003, 07:24:34 PM »

Hello again!

Few quick questions. Is it possible to get the parallax scrolling to work only horizontally? I mean that I have a sky sprite that I want to scroll only horizontally but now it scrolls it automatically both ways (horizontally & vertically) and it doesn't look right, the clouds look kind a funny ;).

And the second one. Is possible to keep the sky sprite "scrolling" after the actor stops walking?  Can this be made with scripts?


Logged
"Do you still wish to fight me?"

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re:Sky scrolling
« Reply #1 on: May 09, 2003, 08:36:58 PM »

Quote
And the second one. Is possible to keep the sky sprite "scrolling" after the actor stops walking?  Can this be made with scripts?

To animate something without messing with pallarax scrolling, the best way it the make that "something" an entity. Then you can animate this entity by using scripts
Logged
fl*p

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 690
    • View Profile
Re:Sky scrolling
« Reply #2 on: May 10, 2003, 10:17:19 AM »

Few quick questions. Is it possible to get the parallax scrolling to work only horizontally? I mean that I have a sky sprite that I want to scroll only horizontally

Yes, just use the same vertical layer size for the sky sprite as you use for your main layer.

You might want to take a look in the WME demo and open the Room scene with SceneEdit. You will discover that the main layer and the sky layer use the same height, so if they scroll vertically, they scroll together, but horizontally you have the parallex scrolling.

Quote
And the second one. Is possible to keep the sky sprite "scrolling" after the actor stops walking?  Can this be made with scripts?

Yes, as odnorf already mentioned this should be possible by using the sky as an entity instead of a layer. Just try around with it and ask here when you see problems.

Logged
Mooh!

Helgiii

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 18
    • View Profile
Re: Sky scrolling
« Reply #3 on: February 13, 2008, 03:40:57 PM »

The topic is pretty old.. but I don't want to spawn clones
The question is:
how do I make scrolling clouds (not the sky)?...
I have a static image of the sky and I want to script clouds to randomly move this way and that way with different speeds and scaling..
this is going to be my first WME script..

1. in the level editor I've created an entity which I called Clouds
2. attached a script to that entity.
3. I have 3 images of the clouds
what do I do next?

where do I write the code that would move my clouds randomly (I mean the code that would run each screen update)
as far as I know the code I write in the attached script is executed only once, when the object is loaded..
Logged

Helgiii

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 18
    • View Profile
Re: Sky scrolling
« Reply #4 on: February 13, 2008, 04:01:57 PM »

ok.. I've managed to move one cloud..
so in the level editor I've added one entity just for z-ordering - to mark a z-index I will add my sprites to
then in the attached script I've assigned an image to the entity and I do the shifting in the eternal loop..

how do I add more entities (with clouds) at the same z-order..
I need to find out somehow the index of my entity in the layer..
and then I would do
 
var entNewCloud = Scene.GetLayer("Main").InsertEntity(index,"Cloud02");
entNewCloud.SetSprite("sprites\clouds\cloud01.png");

how do I get an index of the entity in the layer?

guess I should iterate through all entities in the layer and find the one that I added in the editor.
then store its index... and add all subsequent entities using this index..
ok I'll do it this way..
guess this looks like talking to myself.. I feel i'm going crazy... :) thinking on paper
« Last Edit: February 13, 2008, 05:14:13 PM by Helgiii »
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sky scrolling
« Reply #5 on: February 13, 2008, 05:51:45 PM »

I'd make a clouds region and use StickToRegion() so you're sure they're correctly positioned.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Helgiii

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 18
    • View Profile
Re: Sky scrolling
« Reply #6 on: February 13, 2008, 05:59:21 PM »

and what's the meaning of that region?.. I mean.. does it specify a z-order only
or it will also force my clouds entities to be within its bounds..
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sky scrolling
« Reply #7 on: February 13, 2008, 06:22:34 PM »

well, you can position this region in the scene z-order and your dynamic entities (clouds) can be easily positioned.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 116
    • View Profile
Re: Sky scrolling
« Reply #8 on: February 14, 2008, 11:24:22 AM »

Also you can do it with particle generator.
Use une cloud as image of the particle, then change the values what you like. For example, the max particles will be 6 and you can do to generate particle between 1 and 60 seconds, with that, not a lot of clouds will be at screen all the time. Next change the velocity to very low and the size of the image between 100% and 20% for example.

Put the particle generation and the sky image in the back layer and the rest of the draw in a layer front (with the sky transparent).

With this you have a perfect random clouds in sky automated.
Logged
 

Page created in 0.038 seconds with 21 queries.