Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
You can draw more than one sprite for any instance if you wish. For example drawing a second sprite at x+5 , y+5 would draw it 5 pixels to the right and 5 pixels lower. If you draw this sprite before you draw the main sprite at x,y it would appear behind it as the main sprite draws over it.
Instead of x+5 , y+5 you could use your own variables and use the step even to change them based on where the instance is in the room. Or react to how the instance is moving or anything else.
For example you could create a cloud, set it in motion and draw another cloud with maybe some transparency and a different position. Essentially, you need to figure out what you want the x and y to be in relation to some other instance, and probably use the step event to update them.
Don't know if i was helpful there. Explain your problem in more detail. The answer is partly in the question if ask it right.
Here is the code in its create event:
while (instance_number(obj_star) < 500) {
instance_create(random(room_width), random(room_height), obj_star);
}
The problem is that when my character runs along the room with the view, the stars are move to the left when in reality, the sky is very far away and they should be relativley stationary and move at the same speed as my character.
So as you were saying i need to figure out how to move the stars in relation to the camera but I can't figure it out (I'm bad at coding and newish to gamemaker).
All the youtube tutorials do parallax effects only with backgrounds either with tiled backgrounds or manually placing backgrounds around the room. The two downsides to this is that you can't have animated backgrounds (and my stars have a sort of twinkle effect to them) and the other is that it is way easier to have the computer place stars than do it manually with that random spawner I have set up which I could apply to other things in the future.
In the obj_star step event I tried:
hspd = view_hspeed;
x += hspd;
but it doesn't work.
Thanks
how large is the room?
do you want the stars to move just a little, or not at all?
If you want them to move a little, i wrote some examples, a bit too large to post here directly:
http://pastebin.com/Sng5h1kL
(i messed up syntax highlighting. bad luck)