Jump to content


spicydeath82

Member Since 06 Aug 2004
Offline Last Active Dec 05 2011 02:05 AM

Topics I've Started

adding a high score to custom scores list

23 June 2011 - 02:33 PM

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?

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.
//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

custom orbit script not working

07 July 2010 - 08:48 PM

this doesn't want to work...

/*
    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!