Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Red Rings and View Scroll [GM8]


Recommended Posts

Well I'm experiencing problems with these two things.

The view stays centered on Sonic when I'd rather have it more to the right or left depending on which way your moving. I was thinking:

if player.dir=1 (right) {view_xview[0].x=player.x+100}

I'm not sure if how that would work as I've tried something like this and it didn't work. Also for red rings, how would I make them disable after they've been collected. I know how to ADD to the total amount but not how to completely disable them. I can destroy them but if you restart they're back. If you could help that would be nice.

Link to comment
Share on other sites

Not sure about the view scroll, but in the case of the Red Rings, you could do like saving it to a save file and checking those values in some way when the stage starts.

I'm not sure how GM save system works but in MMF2 you can use INIs for those things, creating a group (Red_Rings_Stage_1) with an item for each ring (RedRing1, RedRing2, etc...) and then saving a value when the player collects them (like 1). Then, at the start of the stage, check if the value is 0 (false) or 1 (true) and destroy the ring according to that. Not sure if it's the best way to do it, but it should work.

Again, I don't really know anything about GameMaker, but I'm deadly sure you can do something similar with it. As long as you can save values to a file, you should be able to do it.

Link to comment
Share on other sites

Sorry for DP update:

Do you think this would work?

//Make collison detection bigger

if collision_circle(x,y,25,player_basic,0,1) && player_basic.enable=1 && able=1

{

//<--Play sound here

global.red_rings+=1

ini_open('SADS.txt')

if num=1

{ini_write_real('REDRING','redring1','2')}

if num=1

{ini_write_real('REDRING','redring2','2')}

if num=1

{ini_write_real('REDRING','redring3','2')}

if num=1

{ini_write_real('REDRING','redring4','2')}

if num=1

{ini_write_real('REDRING','redring5','2')}

ini_close()

instance_destroy()

}

if num=1 && ini_read_real('REDRING','redring1','2')

{able=0 image_alpha=0.25}

if num=2 && ini_read_real('REDRING','redring2','2')

{able=0 image_alpha=0.25}

if num=3 && ini_read_real('REDRING','redring3','2')

{able=0 image_alpha=0.25}

if num=4 && ini_read_real('REDRING','redring4','2')

{able=0 image_alpha=0.25}

if num=5 && ini_read_real('REDRING','redring5','2')

{able=0 image_alpha=0.25}

if num=1 && ini_read_real('REDRING','redring1','0')

{able=0 image_alpha=1}

if num=2 && ini_read_real('REDRING','redring2','0')

{able=0 image_alpha=1}

if num=3 && ini_read_real('REDRING','redring3','0')

{able=0 image_alpha=1}

if num=4 && ini_read_real('REDRING','redring4','0')

{able=0 image_alpha=1}

if num=5 && ini_read_real('REDRING','redring5','0')

{able=1 image_alpha=1}

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...