Jump to content


Photo

Make Some Objects Stay In One Place On The Screen,


  • Please log in to reply
2 replies to this topic

#1 zfan122

zfan122

    GMC Member

  • New Member
  • 780 posts

Posted 22 January 2008 - 03:40 PM

Ok so I got this game demo ready, it's the first version and I need to know how to keep the play, stop, next, & last buttons in the same spot while the view is following the player object. I'm making a sonic game but you can decide wether or not you want to hear that(sometimes) annoying background music, or change the song that's playing to a different zone while staying in the same one! So if you guys know how to do it please tell me. Here's the first playable demo without the player object in it. If you get the Sound does not exist error just click ignore and the song will play. http://www.mediafire.com/?1mddgmnjerj
  • 0

#2 Appo117

Appo117

    GMC Member

  • Validating
  • 219 posts

Posted 22 January 2008 - 03:53 PM

Here's what you should do, in the end step event of the button objects, put this code;
self.x=view_xview[0]+(x coordinate of the button)
self.y=view_yview[0]+(y coordinate of the button)

This will make the instance in and of itself stay on screen. The only problem is that the sprite will be jumpy when the view shifts. To fix this, go to the draw event and put this;

draw_sprite(sprite_index,-1,view_xview[0]+(x coordinate of the button),y=view_yview[0]+(y coordinate of the button)

That outta' do it. Tell me if it works out k?

#3 zfan122

zfan122

    GMC Member

  • New Member
  • 780 posts

Posted 24 January 2008 - 12:43 AM

Here's what you should do, in the end step event of the button objects, put this code;

self.x=view_xview[0]+(x coordinate of the button)
self.y=view_yview[0]+(y coordinate of the button)

This will make the instance in and of itself stay on screen. The only problem is that the sprite will be jumpy when the view shifts. To fix this, go to the draw event and put this;

draw_sprite(sprite_index,-1,view_xview[0]+(x coordinate of the button),y=view_yview[0]+(y coordinate of the button)

That outta' do it. Tell me if it works out k?

<{POST_SNAPBACK}>

K I will, it's for my sonic project. Well i've changed the game story a little bit, and I plan on actually having some playable stages. But you can (for once) decide weather or not you want to hear the background music! Also if you have enough rings at the end of each stage something good will happen. Can't tell you yet, cause it's a surprize! But I WOULD like some tile sets from sonic 2 & to know how to set up the screen you see after completing a special stage in sonic 3 in GM. I'm trying to use as much D&D as I can cause I'm new at this, but I'll try the code and see if it works. (If you could help with the other things that'd be great too!)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users