hi. i'm currently working on a project that requires there be multiple custom high score lists.
the problem face is that i'm un sure of how to add a new entry to the list.
here's my score init script:
// initialize the variables
globalvar demo_highscore,demo_highscore_name,demo_score;
demo_score=0;
here's a script i use to check if there's any highscores present and if not then add the default values:
if(demo_highscore[0]>0){exit;} // already has highscores so exit
// no high scores yet so let's set them to default values
else
{
// first place
demo_highscore[0]=1000;
demo_highscore_name[0]="Robert";
// second
demo_highscore[1]=900;
demo_highscore_name[1]="Richard";
//third
demo_highscore[2]=800;
demo_highscore_name[2]="Mark";
// fourth
demo_highscore[3]=700;
demo_highscore_name[3]="Sandy";
//fifth
demo_highscore[4]=600;
demo_highscore_name[4]="Mike";
// sixth
demo_highscore[5]=500;
demo_highscore_name[5]="TV";
// seventh
demo_highscore[6]=400;
demo_highscore_name[6]="Lucian";
// eighth
demo_highscore[7]=300;
demo_highscore_name[7]="George";
// ninth
demo_highscore[8]=200;
demo_highscore_name[8]="Joe";
//tenth
demo_highscore[9]=100;
demo_highscore_name[9]="Casual Gamer";
}
what i need help with is a way to advance the positions down. so given the scores above, say i score 1001 points and get the top score, how do i compare my score to all those in the list, replace the score i've beaten, then shift the old top score from position[0] to [1] and so on down the line?
- Game Maker Community
- → Viewing Profile: Topics: spicydeath82
spicydeath82
Member Since 06 Aug 2004Offline Last Active Dec 05 2011 02:05 AM
About Me
Been playing games since i was 5. the first of which was super Mario bro.s followed closely by the legend of Zelda and fester's quest. I discovered game maker by accident. I was searching for a level editor for super mario brothers for use with emulators. Been using it since. My first games were basically breakout minus the bricks since i didn't know about instance_destroy() at that time. i didn't really get gml till i followed a gml tut my carl gustafson on how to make a scrolling shooter. I've only released two games at yoyo but i have made many proto types trying to duplicate game systems/features. i think the shift from the old gamemaker.nl site to yoyo games has been for everyone's benefit. I do miss hearing from mark overmars on the glog though and wonder if he's left the community he helped start.
Community Stats
- Group New Member
- Active Posts 138
- Profile Views 2341
- Member Title Awesomesauce
- Age 30 years old
- Birthday October 7, 1982
-
Gender
Male
-
Location
A place where the sun don't ever shine...
-
Interests
stuff... and things, can't forget the things...
-
Version
GM8
1
none
Friends
spicydeath82 hasn't added any friends yet.
Latest Visitors
Topics I've Started
adding a high score to custom scores list
23 June 2011 - 02:33 PM
Weird issue with draw event
13 January 2011 - 06:13 AM
Hi, ran into a weird issue while trying draw multiple sprites in one object.
this code executes in the obj_tank's draw event.
the issue is that only the tank body and the pattern appear. the turret doesn't appear and neither does it's pattern or it's barrels as depicted by turret type.
any ideas? too many switch statements messing it up?
this code executes in the obj_tank's draw event.
//this will attempt to draw all the relevant sprites for the tank.
switch(body_color)// draws the tanks main body with the appropiate color
{
case COLOR_GREEN:draw_sprite(spr_body_green,image_speed,x,y); image_angle=direction;break;
case COLOR_RED:draw_sprite(spr_body_red,image_speed,x,y);image_angle=direction;break;
case COLOR_BLUE:draw_sprite(spr_body_blue,image_speed,x,y);image_angle=direction;break;
case COLOR_WHITE:draw_sprite(spr_body_white,image_speed,x,y);image_angle=direction;break;
case COLOR_PINK:draw_sprite(spr_body_pink,image_speed,x,y);image_angle=direction;break;
case COLOR_PURPLE:draw_sprite(spr_body_purple,image_speed,x,y);image_angle=direction;break;
break;
}
/*switch(armor_type)//draws the appropiate armor on the body
{
case ARMOR_LIGHT:draw_sprite();image_angle=direction;break;
case ARMOR_MEDIUM:draw_sprite();image_angle=direction;break;
case ARMOR_HEAVY:draw_sprite();image_angle=direction;break;
}
*/
if(pat_type!=PAT_NONE)// checks to see if player has picked a pattern and if so draws the pattern for the body
{
switch(pat_type)
{
case PAT_STRIPE:// pattern equals stripe so now find which color
switch(pat_color)
{
case COLOR_WHITE:draw_sprite(spr_stripe_bod_white,0,x,y);image_angle=direction;break;
}
break;
}
break;
}
switch(turret_color)// draws the tanks main body with the appropiate color
{
case COLOR_GREEN:draw_sprite(spr_turret_green,0,x,y); image_angle=direction;break;
case COLOR_RED:draw_sprite(spr_turret_red,0,x,y);image_angle=direction;break;
case COLOR_BLUE:draw_sprite(spr_turret_blue,0,x,y);image_angle=direction;break;
case COLOR_WHITE:draw_sprite(spr_turret_white,0,x,y);image_angle=direction;break;
case COLOR_PINK:draw_sprite(spr_turret_pink,0,x,y);image_angle=direction;break;
case COLOR_PURPLE:draw_sprite(spr_turret_purple,0,x,y);image_angle=direction;break;
break;
}
switch(turret_type)// draws the right type of barrel
{
case TURRET_SINGLE:draw_sprite(spr_barrel_single,0,x,y);image_angle=direction;break;
case TURRET_DOUBLE:draw_sprite(spr_barrel_double,0,x,y);image_angle=direction;break;
case TURRET_LARGE:draw_sprite(spr_barrel_large,0,x,y);image_angle=direction;break;
break;
}
if(pat_type!=PAT_NONE)// checks to see if player has picked a pattern and if so draws the pattern for the turret
{
switch(pat_type)
{
case PAT_STRIPE:// pattern equals stripe so now find which color
switch(pat_color)
{
case COLOR_WHITE:draw_sprite(spr_stripe_tur_white,0,x,y);image_angle=direction;break;
}
break;
}
break;
}
break;
//to do: add in support for drawing add ons once they are created
the issue is that only the tank body and the pattern appear. the turret doesn't appear and neither does it's pattern or it's barrels as depicted by turret type.
any ideas? too many switch statements messing it up?
Meteor Blaster returns
20 November 2010 - 09:20 PM
hi all just stopping by to announce a new version of my game meteor blaster has been uploaded. feature in-depth help menus, quick control guide, eliminates the use of the built in info dialog. whole new title menu and ending credits. a number of bug fixes as well.
check it out at:
http://www.yoyogames...-meteor-blaster
check it out at:
http://www.yoyogames...-meteor-blaster
custom orbit script not working
07 July 2010 - 08:48 PM
this doesn't want to work...
how ever doing code snippets with this:
CREATE
orbitspeed=0;
STEP(end event)
orbitspeed=10;
x=object.x+lengthdir_x(object.sprite_width*dist,orbitspeed)
y=object.y+lengthdir_y(object.sprite_height*dist,orbitspeed)
the above works but isn't ideal as i want to use it as a simple script... any ides folks?
/*
Created by SpicyDeath82 / Opposing Forces Studios
this script allows you to have an object orbit another object
you place this in a step event(best in end step)
orbit_object(object,dist,orbitspeed);
*/
object=argument0; // the object to orbit
dist=argument1; // this gets multiplied against the sprite's dimensions
orbitspeed=argument3; // use a negative value for reverse direction
x=object.x+lengthdir_x(object.sprite_width*dist,orbitspeed)
y=object.y+lengthdir_y(object.sprite_height*dist,orbitspeed)
all the orbiting object does is jump to the right of the object it's supposed to orbit.how ever doing code snippets with this:
CREATE
orbitspeed=0;
STEP(end event)
orbitspeed=10;
x=object.x+lengthdir_x(object.sprite_width*dist,orbitspeed)
y=object.y+lengthdir_y(object.sprite_height*dist,orbitspeed)
the above works but isn't ideal as i want to use it as a simple script... any ides folks?
How Do You Use Game Maker?
18 January 2010 - 07:34 PM
I've been a user of Game Maker for a number of years and I find that at times my focus shifts back and forth between making games and trying out ideas.
Game Maker is a convenient piece of software to proto type concepts, test system ideas, Etc.
so this poll is out of personal curiosity to see how many other Members of this community fall into these various categories.
I make games.
I test ideas
both
or nothing at all(no longer uses GM but remains active in the forums)
How Do you Use Game Maker?
To experiment with concepts / ideas. | To make games. | A bit of both 1 & 2. | I don't use Game Maker
Already voted? See the results!
Game Maker is a convenient piece of software to proto type concepts, test system ideas, Etc.
so this poll is out of personal curiosity to see how many other Members of this community fall into these various categories.
I make games.
I test ideas
both
or nothing at all(no longer uses GM but remains active in the forums)
How Do you Use Game Maker?
To experiment with concepts / ideas. | To make games. | A bit of both 1 & 2. | I don't use Game Maker
Already voted? See the results!
- Game Maker Community
- → Viewing Profile: Topics: spicydeath82
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content