Welcome Guest [Log In] [Register]



Add Reply
Backround (GML); just some basic stuff
Topic Started: Jun 12 2006, 10:48 PM (503 Views)
fsd
3a4

ok
first of all if it is a picture i would streach it (get a new picture) or change the room size
and you can have more than one backround on one room also a backround color
and you might wounder why?
cuz backrounds dont need to take up all the room and you can position them
(eventhough i would use it as a title set , but not make them a title set, to place them were i want
you can also choose a horizontal speed and a vertical speed
but you might want to know how people make there backround move with the game?
well you just place the folloing script in the step even of an object that is in the room
Code:
 
background_x=view_xview[0] background_y=view_yview[0]

but if you want more controll you could just chang your backround x and y (not to the veiw)
you could use an object or somthing

there is my little tutorial

Changed title to match new standards
--ari_aaron
"mmmmm i love the internet. every time i go to a website i get a cookie HOW AWESOME IS THAT!" - Quote from me


"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - Albert Einstein
"Imagination is more important than knowledge."- Albert Einstein
Offline Profile Quote Post Goto Top
 
Blomp
Member Avatar

Moderators
when i read this first i thought it was a question being asked :unsure:

but yeah this is good information for beginners, i just spent about half an hour trying to explain something similar to a friend.
Offline Profile Quote Post Goto Top
 
fsd
3a4

ya i know it is symple and not that well writen but hay this is the first thing ever posted in the game maker part of the forum
"mmmmm i love the internet. every time i go to a website i get a cookie HOW AWESOME IS THAT!" - Quote from me


"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - Albert Einstein
"Imagination is more important than knowledge."- Albert Einstein
Offline Profile Quote Post Goto Top
 
Big J
Member Avatar
2

Maybe you are referring to a background that scrolls a bit slower than the view when the view moves? I've done this in 4 directions with my Mario Pacman game using the code

Code:
 
if Mario.direction=0 && Mario.x-view_xview=view_wview/2
   background_x[0]+=Mario.speed/argument0
if Mario.direction=180 && Mario.x-view_xview=view_wview/2
   background_x[0]-=Mario.speed/argument0
if Mario.direction=270 && Mario.y-view_yview=view_hview/2
   background_y[0]+=Mario.speed/argument0
if Mario.direction=90 && Mario.y-view_yview=view_hview/2
   background_y[0]-=Mario.speed/argument0


But this assumes that Mario is always in the center of the view when the view moves. He is, but if I could get it to work no matter where he is, that would be great.
I create and modify my own code... I'm advanced AI!
Big J's Domain
I am an Posted Image in the GM Quiz!
Listen to what the robot has to say... CLICK HERE.
(Macromedia Flash Player 8 required)
GM7 Posted Image is now available!
Super Mario Pong v2.0
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Tutorials · Next Topic »
Add Reply


Theme designed by Sith of Outline