Author Topic: Achievement System  (Read 1578 times)

Realtime911

  • Wannabe
  • Posts: 44
  • Deep Inside The Darkness,There Is One Truth Folded
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 42.0.2311.152 Chrome 42.0.2311.152
    • View Profile
  • Playstyle: Keyboard
Achievement System
« on: May 15, 2015, 05:45:13 AM »
Can somebody teach how to make Achievement Systems like in K3?
Any help is appreciated!
The world will once be inverted, from the colorful world into the Monochrome world, the only color is white and black, you'll never see any color, except the 255 sub color they have.

And you'll be keep falling and falling and falling.
Until you reach the end of the world, a place where darkness is.

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 42.0.2311.152 Chrome 42.0.2311.152
    • View Profile
  • Playstyle: Keyboard
Re: Achievement System
« Reply #1 on: May 15, 2015, 03:15:21 PM »
I think you can do something like that with save data. What I would suggest to start with is in the saving/loading scripts, make lines like:

file_bin_write_byte(f,global.achievement[0]);
file_bin_write_byte(f,global.achievement[1]);

That'll make global.achievement into an array so that it has the same variable but with multiple values attached to it.

To load it, do stuff like:

global.achievement[0] = file_bin_read_byte(f);
global.achievement[1] = file_bin_read_byte(f);

Make sure to put each one at the end of the script but before it stops reading the file.

For drawing it, I would suggest a sprite for each achievement(You can do a single sprite but use image/index, of course.)
Make an object for each achievement and have it draw the sprite if global.achievement[achievement number] = 1.

That's how I would do it. Good luck!
(click to show/hide)

smoke weed everyday

Realtime911

  • Wannabe
  • Posts: 44
  • Deep Inside The Darkness,There Is One Truth Folded
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 42.0.2311.152 Chrome 42.0.2311.152
    • View Profile
  • Playstyle: Keyboard
Re: Achievement System
« Reply #2 on: May 15, 2015, 09:25:05 PM »
It workss!, thank you Lawatson!
The world will once be inverted, from the colorful world into the Monochrome world, the only color is white and black, you'll never see any color, except the 255 sub color they have.

And you'll be keep falling and falling and falling.
Until you reach the end of the world, a place where darkness is.