• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

Game Jam OSG Jam

R

rui.rosario

Guest
Ok, added all sources (even the ones that don't compile) to the shared Dropbox folder.

There is a total of 12 valid entries. Participants are encouraged to try their own games in order to make sure everything is alright. If it is not how it was supposed to be, please PM me so we can check if it was an error on my end or on the participant's end.

@Galladhan & @Threef I am giving one last chance to re-submit the script without the nonexistent functions as long as you don't alter anything else. If however, you take too long to re-submit you are either disqualified by not having a valid entry or when you do re-submit your scripts they will be tagged as being outside of the Jam timeframe.

Also, please DO check your submissions since I had a complete bottle of wine all by myself during the script gathering, recompiling and uploading process, with barely any contents in my stomach.
 

Bingdom

Googledom
This is how i scale my games

Code:
window_set_size(1280,720);
surface_resize(application_surface, 1280, 720);
No issues here :p
 

Galladhan

Member
I am giving one last chance to re-submit the script without the nonexistent functions as long as you don't alter anything else. If however, you take too long to re-submit you are either disqualified by not having a valid entry or when you do re-submit your scripts they will be tagged as being outside of the Jam timeframe.
Oops! Pardon, i totally forgot about the GM:S version :S I fixed it. Thank you! ^^'
 

Mike

nobody important
GMC Elder
I did the following, allowing a smaller room, but one that gets scaled to a bigger window

Code:
// Set up our "retro" screen (320x280)
surface_resize(application_surface,320,200);
window_set_size(320*3, 200*3);
room_width = 320;
room_height = 200;
room_speed = 30;
If you don't set the room size to be the same as your application_surface, then you can get slightly odd results as things scale into the surface.

Also.... @rui.rosario looks like you renamed the script to "osg", which means my script won't work for others if they drag it into a project. It needed to be called "game.gml" (which is how I sent it to you). I didn't see any comment/restriction about the script name - did I miss that?
 
Last edited:

GMWolf

aka fel666
Also.... @rui.rosario looks like you renamed the script to "osg", which means my script won't work for others if they drag it into a project.
Is it recursive?
I really have to check it out to see his it works!
[Edit] that is brilliant! Really genius! Wow, now I instance better how you managed such a complex game! In fact, once you plan it out like that, it's just plain old functional programming! I love it!

If this jam happens again, I may make a tool to generate this kind of code...
 
Last edited:

Micah_DS

Member
I'd still post it...with the source being given out, others can still learn from it.
Just got back from work. I'll go ahead and post my script. It's obviously not a submission, since it's far too late anyway, not to mention it's so incomplete that it's not really even a game.

Unfortunately, in posting my script, I'm not sure it's got much of anything worth learning from. Most everyone already did everything I did, but better, so I guess I just hope people will maybe learn why other people did it better when they look at my code?
My audio creation isn't very good, because I was still in the process of learning how to deal with audio data. And the way I drew sprites was very bad. And I don't like some of the hard coding I did, and I was a little unorganized throughout, etc.

Nevertheless, my script:
Code:
var isInitialized = ds_exists(0, ds_type_grid);
var grid = 0;

var player, sprites;
var stageWidth, stageHeight, gx, gy; // 'gx' and 'gy' are for grid coordinates (see their use below to understand)
stageWidth = 18;
stageHeight = 13;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  Initialize
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if (!isInitialized){

    //let's kick things off by creating the almighty data structure!
    //we'll store literally every bit of data in this thing
    ds_grid_create(20, 15);

      //                //
     // create sounds  //
    //                //

    //create test sound
    //i mostly just followed the example from GM help on this one and still had much to learn but ran out of time
    //please don't try to learn from this, but rather go look at the manual (on 'audio_create_buffer_sound' page)
    var rate, hertz, samples, amplitude, soundBuffer, num_to_write, val_to_write, newSound;
    rate = 44100;
    hertz = 880;
    samples = 44100*0.1;
    amplitude = 255;
    soundBuffer = buffer_create(rate, buffer_fast, 1);
    buffer_seek(soundBuffer, buffer_seek_start, 0);
    num_to_write = rate / hertz;
    val_to_write = 1;
    for (var i = 0; i < (samples / num_to_write) + 1; i++;){
        for (var j = 0; j < num_to_write; j++;){
            buffer_write(soundBuffer, buffer_u8, val_to_write * amplitude);
        }
        val_to_write = (1 - val_to_write);
    }
    hertz = 440;
    num_to_write = rate / hertz;
    for (var i = 0; i < (samples / num_to_write) + 1; i++;){
        for (var j = 0; j < num_to_write; j++;){
            buffer_write(soundBuffer, buffer_u8, val_to_write * amplitude);
        }
        val_to_write = (1 - val_to_write);
    }
    newSound = audio_create_buffer_sound(soundBuffer, buffer_u8, rate, 0, 44100, audio_mono);
    grid[# 19, 1] = newSound; //yay! we now have a lame test sound stored in our grid
  
      //                 //
     // create sprites  //
    //                 //

    var toodee; //why toodee? i'm not really sure either... but it does sound like "2D", so there's that
    toodee = surface_create(64, 64);
    surface_set_target(toodee);

    //create some colors (colors are the same as those of the Pico-8 pallete, because lots of good reasons)
    //some colors may not be used because of plans being cut short
    var p_blue, p_darkblue, p_yellow, p_orange, p_brown, p_tan, p_red, p_darkred, p_green, p_darkgreen, p_gray;
    p_blue = make_colour_rgb(131, 118, 156);
    p_darkblue = make_colour_rgb(32, 51, 123);
    p_yellow = make_colour_rgb(255, 231, 39);
    p_orange = make_colour_rgb(255, 163, 0);
    p_brown = make_colour_rgb(171, 82, 54);
    p_tan = make_colour_rgb(255, 204, 170);
    p_red = make_colour_rgb(255, 0, 77);
    p_darkred = make_colour_rgb(126, 37, 83);
    p_green = make_colour_rgb(0, 131, 49);
    p_darkgreen = make_colour_rgb(69, 69, 69); //i know, it's technically a dark gray. shh
    p_gray = make_colour_rgb(194, 195, 199);

    //create wall tile
    //please don't cry... i'm sorry, it's bad, i know... it wasn't meant to stay like this
    draw_set_color(p_green);
    draw_rectangle(0, 0, 7, 6, false);
    draw_set_color(p_gray);
    draw_line(0, 0, 3, 0) draw_line(4, 0, 7, 0) draw_point(0, 1) draw_point(7, 1) draw_point(0, 2) draw_point(1, 2) draw_point(3, 2) draw_point(6, 2) draw_point(0, 3) draw_point(2, 3) draw_point(3, 3) draw_point(4, 3) draw_point(5, 3) draw_point(7, 3);
    draw_set_color(p_darkblue);
    draw_point(1, 4) draw_point(6, 4) draw_point(0, 5) draw_point(2, 5) draw_point(4, 5) draw_point(5, 5) draw_point(7, 5) draw_point(1, 6) draw_point(2, 6) draw_point(4, 6) draw_point(6, 6) draw_line(-1, 7, 7, 7);
  
    //draw player character
    //the bad example continues...
    draw_set_color(p_red);
    draw_point(10, 0) draw_point(11, 0) draw_point(9, 1) draw_point(10, 1) draw_point(10, 4) draw_line(10, 5, 13, 5);
    draw_set_color(p_darkred);
    draw_point(12, 0) draw_point(13, 0) draw_point(11, 1) draw_point(9, 2) draw_point(10, 2) draw_point(9, 3) draw_point(9, 4) draw_point(10, 5);
    draw_set_color(p_tan);
    draw_point(10, 3) draw_point(11, 3) draw_point(13, 3) draw_line(10, 4, 13, 4) draw_point(9, 6) draw_point(14, 6);
    draw_set_color(p_brown);
    draw_point(14, 1) draw_point(13, 2) draw_point(10, 6) draw_point(10, 7) draw_point(13, 6) draw_point(13, 7);
    draw_set_color(p_yellow);
    draw_line(11, 1, 13, 1);
    draw_set_color(p_orange);
    draw_point(11, 2);

    draw_set_color(c_white);
    sprites[1] = sprite_create_from_surface(toodee, 8, 0, 8, 8, false, false, 0, 0); //player -standing
    sprites[0] = sprite_create_from_surface(toodee, 0, 0, 8, 8, false, false, 0, 0); //wall
    grid[# 2, 0] = sprites;
  
    surface_reset_target();
    surface_free(toodee);

      //                   //
     // create core data  //
    //                   //

    //create stage
    //('stage' was going to be a 1d array that contained all the stages as strings, not just the one stage)
    var stage;
    stage = "oooooooooooooooooo"
          + "o       o      o o"
          + "o       o  oo  o o"
          + "o       o      o o"
          + "o o  ooooo    o  o"
          + "o o              o"
          + "o o      D   oo  o"
          + "o o   oooo    o  o"
          + "o o           o  o"
          + "o oo          o  o"
          + "o      oo        o"
          + "o      ooP   oo  o"
          + "oooooooooooooooooo"
    grid[# 1, 0] = stage; //all stage data is stored in this position
  
    //lay out stage (i do this here because i still had no menu, and no more stages, and was testing)
    var stringPos, char;
    stringPos = 1;
    gx = 1;
    gy = 1;
    repeat(stageHeight){
  
        repeat(stageWidth){
      
            char = string_char_at(stage, stringPos);
            if char == "o"{
                grid[# gx, gy] = 1;
            }
            gx += 1;
            stringPos += 1;
        }
        gx = 1;
        gy += 1;
    }
  
    player[1] = 33; //player y
    player[0] = 18; //player x
    grid[# 0, 0] = player; //grid 0,0 holds player's xy position (was planned to hold more than this)

      //              //
     // misc set up  //
    //              //

    audio_master_gain(0.01); //because i don't want to blow anyone's speakers
    room_speed = 60; //because i just can't be okay with 30
    grid[# 0, 1] = 0; //used for window center initialization (see the first 'else if' below)
  
    //resize the window
    var res, roomw, roomh;
    res = 5; //this represents the size of each pixel, multiplying pixels by this number
    roomw = 160;
    roomh = 120;
    if (window_get_width() != roomw*res || window_get_height() != roomh*res){
        surface_resize(application_surface, roomw, roomh);
        view_wview[0]   = roomw;
        view_hview[0]   = roomh;
        view_wport[0]   = roomw;
        view_hport[0]   = roomh;
        view_visible[0] = true;
        view_enabled    = true;
        window_set_size(roomw*res, roomh*res);
        exit;
    }
}
//center the window on the second step
else if grid[# 0, 1] == 0{
    grid[# 0, 1] = 1;
    window_center();
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  Main
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//first we grab all the necessary data for this section
player = grid[# 0, 0];

//basic movement for testing
var px, py, px_move, py_move;
px = player[0];
py = player[1];
px_move = 0;
py_move = 0;
if keyboard_check_direct(vk_left){
    px_move -= 1;
}else if keyboard_check_direct(vk_right){
    px_move += 1;
}else if keyboard_check_direct(vk_up){
    py_move -= 1;
}else if keyboard_check_direct(vk_down){
    py_move += 1;
}
px += px_move;
py += py_move;
player[@ 0] = px;
player[@ 1] = py;
grid[# 0, 0] = player;

//test sound playing
if keyboard_check_pressed(ord('S')){
    audio_play_sound(grid[# 19, 1], 1, false);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  Draw
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//like we did in the main section, we'll grab all the necessary data for this section first
sprites = grid[# 2, 0];

//draw background
draw_set_color(c_black);
draw_rectangle(0, 0, 160, 120, false);
draw_set_color(c_white);

//draw stage
gx = 1;
gy = 1;
repeat(stageHeight){

    repeat(stageWidth){
  
        if grid[# gx, gy] == 1{
            draw_sprite(sprites[0], 0, gx*8, gy*8);
        }
        gx += 1;
    }
    gx = 1;
    gy += 1;
}

//draw player
draw_sprite(sprites[1], 0, px-2, py-1);
//draw a reference dot for testing (supposed to represent the top-left of player character's bbox)
    //draw_set_color(c_blue);
    //draw_point(px, py);
    //draw_set_color(c_white);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  Goodbye?
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//end game with clean up
if keyboard_check(ord('Q')){
    if ds_exists(grid, ds_type_grid){
        ds_grid_destroy(grid); //not sure it's even necessary, but i delete it anyway
    }
    game_end();
}
 

Surgeon_

Symbian Curator
I did the following, allowing a smaller room, but one that gets scaled to a bigger window

Code:
// Set up our "retro" screen (320x280)
surface_resize(application_surface,320,200);
window_set_size(320*3, 200*3);
room_width = 320;
room_height = 200;
room_speed = 30;
If you don't set the room size to be the same as your application_surface, then you can get slightly odd results as things scale into the surface.

Also.... @rui.rosario looks like you renamed the script to "osg", which means my script won't work for others if they drag it into a project. It needed to be called "game.gml" (which is how I sent it to you). I didn't see any comment/restriction about the script name - did I miss that?
No, there aren't any rules on script names - I've also been checking that because I too used recursion to make a sort of "subroutines" :)
 
T

Threef

Guest
@Threef your game won't compile because you use a nonexistent function (buffer_exists), in case you missed it:
Just woke up. buffer_exists() isn't even used in any way in my code. I have sent fixed versions seconds ago but you could have just commented it ;)
Code:
//Clear buffers in next game loop
    for(var i=0; i<10; i++) {
        if(buffer_exists(i)) {
            //buffer_delete(i)
        }
    }
That's how it looked originally. xD Messy code. <3
 

Alice

Toolmaker of Bucuresti
Forum Staff
Moderator
Also.... @rui.rosario looks like you renamed the script to "osg", which means my script won't work for others if they drag it into a project. It needed to be called "game.gml" (which is how I sent it to you). I didn't see any comment/restriction about the script name - did I miss that?
Which is precisely why I replaced all occurrences of goto(...) with script_execute(0,...), as out of possible problems, i.e. @rui.rosario using the wrong script name or having multiple scripts in a one script challenge executable, I deemed the latter less likely. ^^
 

Surgeon_

Symbian Curator
So I played all games and here's what I have to say so far (these aren't votes, just thoughts). I mean no offence to anyone, these are just my own opinions.
(+) = Good
(~) = So-So
(-) = Bad

(+) @Alice (juegOS)
-Nice graphics
-Interesting story and presentation
-Works very well
-Fun mechanics & gameplay
-Even has dialogues!
-Original

(~) @chance (Just Space)
-OK graphics
-Very very short
-Has a menu with the bouncing thing
-Cloned gameplay

(-) @Coded Games (Planet Generator)
-Looks nice
-Custom font
-No gameplay

(~) @JimmyBG (Forest Fox)
-Nice graphics
-3D!
-Cloned gameplay
-Works without errors

(+) @Matthew Brown (Future city)
-Interesting idea
-Reminds me of BSG
-No graphics (and painful colour combination)
-Humourous
-Works without errors

(+) @Mike (Cart Racer)
-Awesome 3D graphics
-Good gameplay
-Works very well
-Has menu
-Retro look
-Fun to play

(-) @Nallebeorn (Ninja)
-Nice animations
-No gameplay

(+) @Nocturne (Asteroids)
-Amazing 2D graphics
-Has menu
-Works very well
-Cloned gameplay

(~) @Psycho Delph (Skull shooter)
-Nice graphics
-Nice fake depth
-No gameplay
-Lags when you click

(-) @shadowspear1 (TDS)
-Almost no graphics
-No gameplay

(+) Surgeon_ (Not tetris)
-I'm biased

(+) @YellowAfterlife (Pool of Doom)
-Original idea
-Fun gameplay & interesting mechanics
-Very good 3D graphics
-Works very well
 

PsychoDelph

Member
So I played all games and here's what I have to say so far (these aren't votes, just thoughts)
Interesting :D
Lags when you click
It designed to freeze with every click, so that you can better see the result of your shot :p
I knew, that I won't be able to devote much time on this game, that's why I chose a simple idea, and even then I could neither add normal gameplay nor finish it. By the way I decided not to use 0-indexed data structure approach.

( @Alice's recursive script calling with different arguments is genius! )
 

JimmyBG

Member
Introducing the OSG Multicart!

Was interesting getting them to play nicely with each other, unfortunately a couple wouldn't join in :p



Download:
osg_multicart.zip

Edit: Everyone's game is in now!
 
Last edited:
R

rui.rosario

Guest
Also.... @rui.rosario looks like you renamed the script to "osg", which means my script won't work for others if they drag it into a project. It needed to be called "game.gml" (which is how I sent it to you). I didn't see any comment/restriction about the script name - did I miss that?
Ooops, sorry. When I gathered the scripts I renamed them for consistency, but when compiling I fixed those cases as they were showing up. I just forgot to fix it in the scripts themselves :p I'll update them in the Dropbox folder. It was just your two scripts @Mike and @Surgeon_, right? (And @Alice, I loved your recursion scheme :p)
 

PsychoDelph

Member
Great work for combining these together! I create background to make tiles from it. I don't know why error pops up... "Run first" looks like some kind of privilege :cool:

@chance's game became way easier. It plays twice slower

UPD: Oh! I think I figured out why error occurs. I check application_surface_enabled() to determine whether the script called for the first time. Some game disables it, so init section never executed
 
Last edited:

PsychoDelph

Member
Updated source. Should work without errors.

Code:
////
/*

City layers:  10, 20, 30
Enemy layers: 100
Target layer: 1

*/


////  Initialization  ////

  // values and consts
var _msec = get_timer() * 0.001;


background_colour = make_colour_hsv(irandom(255) + 255 * _msec * 0.000005 , irandom(150)+80, irandom(63)+160);
texture_set_interpolation(false)

var build_layer_count = 3
var mouse_affect_x = 0.1
var mouse_affect_y = 0.2
var max_time = 30 * 60 * 1000
var max_shots = 150
var enemy_depth = 100
var target_depth = 1
var ui_depth = 2

// short one-time init
if random_get_seed() != (current_day + 1234) {
  application_surface_enable(false)
  // graphics
  window_set_cursor(cr_none)
  room_speed = 60
  var _img;
  _img[0] =
    "................" +
    "########........" +
    "#############..." +
    ".##############." +
    ".###############" +
    ".####....#######" +
    ".#####...#####.#" +
    "..####..#.###..#" +
    "..####..#####.##" +
    "..#####.#####.##" +
    "..##############" +
    "...############." +
    "....###########." +
    ".......###...##." +
    "........###.###." +
    "................" ;
  _img[1] =
    "......####......" +
    "......####......" +
    ".......##......." +
    ".......##......." +
    ".......##......." +
    "................" +
    "##............##" +
    "#####......#####" +
    "#####......#####" +
    "##............##" +
    "................" +
    ".......##......." +
    ".......##......." +
    ".......##......." +
    "......####......" +
    "......####......" ;
  _img[2] =   
    ".##...##########" +
    ".##...##########" +
    ".##...##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" +
    "####..##########" ;
    
  var _img_count = array_length_1d(_img)
        
  var _surf = surface_create(16*_img_count, 16) 
  surface_set_target(_surf)
    draw_clear_alpha(c_white, 0)
    draw_set_colour(c_white)
    for (var i=0; i<_img_count; i++) {
      var _x = i*16
      var _p = 0
      for (var _y=0; _y<16; _y++)
      for (var xx=0; xx<16; xx++) {
        _p++
        if string_char_at(_img[i], _p) == "#"
          draw_point(_x+xx, _y)
      }
    } 
  surface_reset_target()
 
  if not background_exists(background_index[0]) {
    background_index[0] = background_create_from_surface(_surf, 0, 0, 16*_img_count, 16, false, false)
  }   
  if not background_exists(background_index[1]) {
    background_index[1] = background_create_colour(32, 32, c_white)  // img_build
  }   
 
  surface_free(_surf)

  // target
  var target = tile_add(background_index[0], 16, 0, 16, 16, 0, 0, target_depth)
  tile_set_scale(target, 2, 2)

  // ui
  var _x = 50 
  var _tile;
  for (var i=0; i<ceil(max_shots*0.6); i++) {
    _x +=4+2
    _tile = tile_add(background_index[0], 32,0, 4, 16, _x, room_height*0.9, ui_depth)
  }
 
}


enum _bl {    // build_layer properties
  count,
  color,
  scale,
  width,
  depth
}
enum _i {     // img properties
  index,  // background index
  width,  // within background
  height,
  x, y
}

var img_enemy = 0;
img_enemy[_i.index]  = background_index[0]
img_enemy[_i.x] = 0
img_enemy[_i.y] = 0
img_enemy[_i.width]  = 16
img_enemy[_i.height] = 16

var img_build = 0;
img_build[_i.index]  = background_index[1]
img_build[_i.x] = 0
img_build[_i.y] = 0
img_build[_i.width]  = 32
img_build[_i.height] = 32


// city
// delete city tiles

for (var i=0; i<build_layer_count; i++) {
  var _tiles = tile_get_ids_at_depth((i+1)*10);
  for (var j=0; j<array_length_1d(_tiles); j++)
  if tile_exists(_tiles[j])
    tile_delete(_tiles[j])
}   

// generate city
random_set_seed(1)
var builds = 0;     
var build_layer = 0;
build_layer[2, _bl.count] = 9    // far
build_layer[1, _bl.count] = 18   // mid
build_layer[0, _bl.count] = 24   // near

// init array
for (var i=build_layer_count-1; i>=0; i--) {
  builds[i, build_layer[i, _bl.count]] = 0        // [layer, num of builds]
}


// create tiles
for (var i=0; i<build_layer_count; i++) {
  build_layer[i ,_bl.width] = 0
  build_layer[i, _bl.depth] = (build_layer_count-i) * 10
  build_layer[i, _bl.color] = make_colour_hsv(
    colour_get_hue(background_colour),
    colour_get_saturation(background_colour),
    colour_get_value(background_colour)/(build_layer_count+1) * (build_layer_count-i)
  ) 
  for (var j=0; j<build_layer[i, _bl.count]; j++) {
    var _ysc = random_range(2.5, 7);
    var _xsc = random_range(1, _ysc);
    builds[i,j] = tile_add(
      img_build[_i.index],
      img_build[_i.x],  img_build[_i.y],
      img_build[_i.width],
      img_build[_i.height],
      build_layer[i, _bl.width],
     -img_build[_i.height] * _ysc,
      build_layer[i, _bl.depth]
    )
    
    tile_set_scale(builds[i,j], _xsc, _ysc)
    tile_set_blend(builds[i,j], build_layer[i, _bl.color])
    build_layer[i, _bl.width] += img_build[_i.width] * _xsc // + i*10*sqr(sqr(random(2)))
  }
  build_layer[i ,_bl.scale] = 24/build_layer[i, _bl.depth]
//    build_layer[i ,_bl.scale] = room_width / build_layer[i ,_bl.width]
//    build_layer[i ,_bl.scale] = (room_width + room_width * build_layer[i, _bl.scale] * mouse_affect_x) / build_layer[i ,_bl.width]
} 

// arrange tiles
for (var i=0; i<build_layer_count; i++)
for (var j=0; j<build_layer[i, _bl.count]; j++) {
  tile_set_position(
    builds[i,j],
    tile_get_x(builds[i,j])*build_layer[i, _bl.scale],
    tile_get_y(builds[i,j])*build_layer[i, _bl.scale]+ room_height + (room_height*1.25*sqr(i/build_layer_count)),
  )
  tile_set_scale(
    builds[i,j],
    tile_get_xscale(builds[i,j])*build_layer[i, _bl.scale],
    tile_get_yscale(builds[i,j])*build_layer[i, _bl.scale]
  )
}

// target
var target = tile_get_ids_at_depth(target_depth)
target = target[0]



////  Implementation  ////

// input
if keyboard_check(vk_escape) or
   keyboard_check(vk_backspace) {
  
   background_delete(background_index[0])
   background_delete(background_index[1])
   application_surface_enable(true)
   game_end()
}
var _show_debug = keyboard_check(vk_f3)
var _dmx = mouse_x - tile_get_x(target)
var _dmy = mouse_y - tile_get_y(target)
var click = mouse_check_button_pressed(mb_left)




// place enemies at "source" position before moving around
var enemies;
enemies = tile_get_ids_at_depth(enemy_depth)
//enemies[0] = 0
var enemy_count = array_length_1d(enemies)
for (var i=0; i<enemy_count; i++)
if tile_exists(enemies[i]) {
  tile_set_position(enemies[i],
    tile_get_x(enemies[i]) + tile_get_width (enemies[i]) * tile_get_xscale(enemies[i])* 0.5,
    tile_get_y(enemies[i]) + tile_get_height(enemies[i]) * tile_get_yscale(enemies[i])* 0.5
  )
 
//  tile_set_position(enemies[i],
//    tile_get_x(enemies[i]) - 5 * tile_get_xscale(enemies[i]) , 
//    tile_get_y(enemies[i])
//  )
}

// spawn new enemy
var _rate = sqrt(_msec / max_time)*0.1
var _tile, _sc;
randomize()
if random(1)<_rate {
  background_colour = make_colour_hsv(
    colour_get_hue(background_colour),
    colour_get_saturation(background_colour),
    255
  )

  _tile = tile_add(
    img_enemy[_i.index],
    img_enemy[_i.x], img_enemy[_i.y],
    img_enemy[_i.width], img_enemy[_i.height],
    irandom(room_width-200)+100,
    irandom(room_height*0.25),
    enemy_depth
  ) 
  _sc = 0.1 + random(1)
  tile_set_scale(_tile, _sc, _sc)
}

// update city
for (var i=0; i<build_layer_count; i++)
for (var j=0; j<build_layer[i, _bl.count]; j++) {
  tile_set_position(
    builds[i,j],
    tile_get_x(builds[i,j])-mouse_x * mouse_affect_x * build_layer[i, _bl.scale],
    tile_get_y(builds[i,j])-mouse_y * mouse_affect_y * build_layer[i, _bl.scale]
  )
}

// update enemies
var _sc, _al;
var kill_fail = false

for (var i=0; i<enemy_count; i++)
if tile_exists(enemies[i]) {
  _sc = tile_get_xscale(enemies[i])
  // scaling
  _sc = _sc * 1.01
  tile_set_scale(enemies[i], _sc, _sc)
  tile_set_position(enemies[i],
    tile_get_x(enemies[i]) - tile_get_width (enemies[i]) * tile_get_xscale(enemies[i])* 0.5,
    tile_get_y(enemies[i]) - tile_get_height(enemies[i]) * tile_get_yscale(enemies[i])* 0.5,
  )
  // mouse
  tile_set_position(enemies[i],
    tile_get_x(enemies[i]) - _dmx * tile_get_xscale(enemies[i])*0.05 ,
    tile_get_y(enemies[i]) - _dmy * tile_get_yscale(enemies[i])*0.1,
  )
 
  // moving
  tile_set_position(enemies[i],
    tile_get_x(enemies[i]) + (1.5-1/tile_get_xscale(enemies[i]))*1.5 , 
    tile_get_y(enemies[i]) + sqr(sqr(tile_get_xscale(enemies[i])*0.5))
  )
 
  tile_set_blend(enemies[i], 0)

  _al = 1 - sqr((6-tile_get_xscale(enemies[i]))/6)
  tile_set_alpha(enemies[i], _al)
  if tile_get_y(enemies[i]) > room_height {
    tile_delete(enemies[i])
    kill_fail = true 
  }
 
}

// update target
tile_set_position(target, mouse_x, mouse_y)


// process mouse
// count shots   
var shot_ok = false
var kill_ok = false
var _tile;

if click {
  _tile = tile_get_ids_at_depth(ui_depth)
  if tile_exists(_tile[0]) {
    tile_delete(_tile[array_length_1d(_tile)-1])
    for (var i=0; i<enemy_count; i++) {
      _tile = tile_layer_find(
        enemy_depth,
        tile_get_x(target) + tile_get_width (target)*tile_get_xscale(target)*0.5,
        tile_get_y(target) + tile_get_height(target)*tile_get_yscale(target)*0.5
      )
      if tile_exists(_tile) {
        tile_delete(_tile)
        kill_ok = true
      } 
      break
    }
    shot_ok = true
  }
}

// add one shot
if kill_ok {
  _tile = tile_get_ids_at_depth(ui_depth)
  var _count = array_length_1d(_tile)
  if _count < max_shots {
    var _x = 50 + (4+2)*(_count+1)
    tile_add(background_index[0], 32,0, 4, 16, _x, room_height*0.9, ui_depth)
    var _x = 50 + (4+2)*(_count+2)
    tile_add(background_index[0], 32,0, 4, 16, _x, room_height*0.9, ui_depth)
 
  }
}

// stun effect
if shot_ok
  room_speed = 5
else
  room_speed = 60

if kill_fail {
  // remove two shot
  repeat(2) {
    _tile = tile_get_ids_at_depth(ui_depth)
    if tile_exists(_tile[0])
      tile_delete(_tile[array_length_1d(_tile)-1])
  }   
}
 
// draw things
// debug
if _show_debug {
  draw_set_color(c_white)
  draw_text(50, 20, string(fps_real))
  draw_text(50, 50,   "Hue: " + string(colour_get_hue(background_colour)) +
                    "; Sat: " + string(colour_get_saturation(background_colour)) +
                    "; Val: " + string(colour_get_value(background_colour))
  )
  draw_text(50, 80,  "rate: "    + string(_rate*100)+"%")
  draw_text(50, 110, "spawned: " + string(enemy_count))
  draw_text(50, 140, "mouse affect:")
  draw_text(50, 170, "     x: " + string(_dmx))
  draw_text(50, 200, "     y: " + string(_dmy))
}


random_set_seed(current_day + 1234)
 
So since I was having problems earlier, I finally figured out what the problem was with the texture interpolation.
For some reason, when you resize the window, there is a slight delay (about 100ms, from my crude testing) for the application surface to reposition itself. Since I was using window_set_size, surface_resize, and texture_set_interpolation all on the first frame of the game. I think that when the window delay is done, it refreshes the interpolation boolean so that you have to update it again. I'm not too sure if this is correct, but basically I had to do this to fix it:
Code:
//hacky way of turning off interpolation... can't do it within the first couple frames apparently.
if (count <= 60) {
    texture_set_interpolation(false);
}
In the first 10 frames or so of the game, using the texture_set_interpolation actually does nothing. It's only after this delay that it starts behaving normally. Here's a reference picture:
 
R

rui.rosario

Guest
@YellowAfterlife & @PsychoDelph yours complain about background images.. perhaps you may know why?
Only occurs if your game isn't ran first.
I've updated the source to not use a hardcoded reference to the background and to cleanup everything on shutdown. That should help.
Updated source. Should work without errors.
Guys, it's ok to update your sources in order for them to work well on the amalgamated runner, but note that the official ones for the competition are the ones you submitted to me, unless you want those updates to reflect in the entry (with the "out of Jam time" notice).

Also, I'll start updating (only now, sorry) the missing sources and stuff. After that I'll start the script validation process.
 

chance

predictably random
Forum Staff
Moderator
I replaced my earlier download with this latest version. I'll re-play the games from this version (single executables), just in case there's any changes.

Are we in the "official reviewing and voting" period now?
 
R

rui.rosario

Guest
I replaced my earlier download with this latest version. I'll re-play the games from this version (single executables), just in case there's any changes.

Are we in the "official reviewing and voting" period now?
Not yet, we are still in the script validation period, as no script has yet been fully validated. You can check the validation progress at the end of the first post.
 

JimmyBG

Member
I've updated the source to not use a hardcoded reference to the background and to cleanup everything on shutdown. That should help.
Updated source. Should work without errors.
Both of your games work now, thanks!

Made the default room speed 60 - @chance's is fine now
Added @Threef's & @Galladhan's to the cart
Made the multicart more.. multicarty~ its also only one script for extra kicks :D



New verision: osg_multicart.zip
 
Last edited:

Coded Games

Member
@JimmyBG The multicart is pretty awesome except it looks like the room speed is set to 60. My game was made at 30 (I know I'm sorry forgot to change it) so on this it runs twice as fast. It really doesn't matter though since my game doesn't really have any gameplay so you don't have to fix it.
 

chance

predictably random
Forum Staff
Moderator
Made the default room speed 60 - @chance's is fine now...(snip)
My game is designed for 30 Hz. I didn't bother to adjust the internal mechanics for different room speeds, since rosario said it would be played in the default GM room.
 

JimmyBG

Member
@JimmyBG The multicart is pretty awesome except it looks like the room speed is set to 60. My game was made at 30 (I know I'm sorry forgot to change it) so on this it runs twice as fast. It really doesn't matter though since my game doesn't really have any gameplay so you don't have to fix it.
Thanks, no worries, interesting how many people relied on the default settings.

My game is designed for 30 Hz. I didn't bother to adjust the internal mechanics for different room speeds, since rosario said it would be played in the default GM room.
@PsychoDelph ^ ^ ^
Oh well, makes it more challenging :)
 

Galladhan

Member
Love the idea of the multicart! =)
I tried all the games super quickly (i have no time at the moment, sigh), and i think you all have done very interesting things, but i wanted to make my compliments especially to @Surgeon_: you had a pretty fresh idea, mate (and the execution looks flawless)!
I really appreciate also @JimmyBG 's Forest Fox. And @Alice 's juegOS, too.
And, of course, i'm VERY impressed by the work of @Mike and @Nocturne, but hey: i was expecting it ;)


A side note (or 2) on my (embarassing) "game": it's called Shooting Star (or something), and you actually shoot at stars, but i forgot to point out that you shoot with the right arrow key ^^'
Ehr...

Also my "game" was intended to run at room_speed = 30 (at 60 is a bit too fast), but it's not a big deal.

Kudos to everybody which is taking part in the Jam (and again: to @rui.rosario for the awesome idea!)
If the jam will continue in the future, i will surely join again (and hopefully i won't be so busy during the jam), cause i had fun and learned things :)

Edit: I forgot to mention @YellowAfterlife 's Pool: impressive stuff, mate!
 
Last edited:

Mike

nobody important
GMC Elder
Although I set the room speed myself, the rules did say we have to start with the default settings, that included a 30fps room speed. Anything else and you had to set it up yourself.
 

Alice

Toolmaker of Bucuresti
Forum Staff
Moderator
Oh, wow, the validation of my entry sure seems to take a while. I could have sworn it's at least 12 hours at that point...

It's almost like, I dunno, there were nearly 3k lines of code to check. :p

(well, at least I run a more or less complete debug run of the game with the breakpoint at the shutdown method, and I have found no local variables to be declared, so that part probably shouldn't be an issue)

Also, @Galladhan - just out of curiosity, have you completed the entire game, or got through the intro so far (you did mention you tried the games super quickly, so you might have left on the first save point, maybe)?
 

Surgeon_

Symbian Curator
@Alice I think you're the only one whose game isn't randomly generated... And has a story - Which justifies those three thousand lines of code. By the way - Does "juegOS" mean anything specific or is it just a random word?
 

JimmyBG

Member
I think I've got the point now, set the room speed to the default 30 :p

@Galladhan Thanks! by the way your game creates files to check if certain parts have run before, but doesn't delete them when its finished.
So you can only run your game once, any time after that results errors of missing buffers and so forth.

Added a scanner to remove any files created (from any game) and changed the room speed.
Final version hopefully: osg_multicart.zip
All previous links have been updated as well

@Alice I wish your game was longer, was quite fun, I think its probably the most complex gameplay wise.
 

chance

predictably random
Forum Staff
Moderator
I run a more or less complete debug run of the game with the breakpoint at the shutdown method
I used the same method. Hadn't thought of it until Mike mentioned this feature in the debugger. It's a quick way to check for any non-local variables.

I found the debugger very useful for this Jam. In particular, the memory management and processing overhead breakdown.
 

Galladhan

Member
Also, @Galladhan - just out of curiosity, have you completed the entire game, or got through the intro so far (you did mention you tried the games super quickly, so you might have left on the first save point, maybe)?
I made the intro in a rush and i forgot to write somewhere that you can start the "game" pressing any key. Then you use the right arrow key for shooting. That's one of the (many) things i would have fixed if i had more time (another error, for example, is that the "ship" spawns too low on the screen):D
At the beginning i had in mind a completely different game, but, time aside, i realized i don't have the skills for something like that, yet, so i tried to stay on something i could manage :)

I think I've got the point now, set the room speed to the default 30 :p

@Galladhan your game creates files to check if certain parts have run before, but doesn't delete them when its finished.
So you can only run your game once, any time after that results errors of missing buffers and so forth.

Added a scanner to remove any files created (from any game) and changed the room speed.
Final version hopefully: osg_multicart.zip
All previous links have been updated as well

@Alice I wish your game was longer, was quite fun, I think its probably the most complex gameplay wise.
Yep i know, my bad. You can press "esc" to go back to the intro screen and then "esc" again to end the game, but if you just kill the window it breaks. Thank you for fixing it :)


EDIT: @Alice... ehm, pardon, i totally misread your question earlier lol. Nope i didn't complete the games, just tried them quickly. I will try them now though.
 
Last edited:
R

rui.rosario

Guest
Oh, wow, the validation of my entry sure seems to take a while. I could have sworn it's at least 12 hours at that point...
Life happened :p

I will however, continue the validation process (and hopefully) go through most if not all of them until "life happens again"
 

Mike

nobody important
GMC Elder
As long as you realise you DO need to break or lift your finger of the gas, it's not bad.... I'm not a fan of racing games where you can just keep your foot in it. :)
 

jazzzar

Member
@Alice your game was the first one i played, i said lemme check the code and see how it's made, i mean how bad can it be, THANK YOU for the headache, i swear i couldn't understand anything of what's going on, what are all these bitwise stuff, am i too dumb i didn't understand s**t? 3K lines of code? too complex stuff for me i ain't going to read more code today, but very clever recursive method i'd say, good game :)
 

Galladhan

Member
I tried the games without being in a hurry and i confirm my first impressions. But i played @Alice's game until the end, this time, and i really liked the idea of using the level design in a "puzzly way". Very nice :)
 

Alice

Toolmaker of Bucuresti
Forum Staff
Moderator
@Surgeon_ Actually, "juego" is a Spanish word for a game, so "juegos" translates to "games" (and OS additionally stands for operating system, of course).

@Alice your game was the first one i played, i said lemme check the code and see how it's made, i mean how bad can it be, THANK YOU for the headache, i swear i couldn't understand anything of what's going on, what are all these bitwise stuff, am i too dumb i didn't understand s**t? 3K lines of code? too complex stuff for me i ain't going to read more code today, but very clever recursive method i'd say, good game :)
Eh-heh-heh, gotta admit, commenting wasn't my top priority when I wrote my entry (especially when I was suffering frequent crashes around the beginning and lost some code to that, then a bit around the middle). Also, now that you mention it that indeed appears I've been using bitwise operations quite heavily; mostly when I wanted to stuff multiple small numbers in a larger variable for some reason or another.

I guess if you want to understand what's going on, you might want to start not from the operations themselves, but from the labels, variable names, the places where specific variables/expressions are used (e.g. whether it's used as a "color" or "sprite" or "filename" parameter of a function or whatever). With knowing the context and seeing *what* some expression is supposed to represent, you might find it easier to learn *why* that specific expression was necessary. For example, a condition like "if (_keypress & INPUT.Action) {...}" should imply that I check for the action key being pressed. Knowing that, one might guess from the bitwise AND being used that variable "_keypress" stores bits indicating whether specific input keys were pressed or not.

@Galladhan Glad you enjoyed my entry. I myself am somewhat surprised I managed to pull off these basic puzzles and, more importantly, the module swapping mechanic. I do plan to expand upon that idea.
 
R

rui.rosario

Guest
Sorry guys, life happened again. I will continue the validation process now.
 
R

rui.rosario

Guest
Officially all scripts passed the 1st stage of validation!! (illegal use of GameMaker variables and clear use of global/local variables).

The playing, voting and review stages are officially open since the 2nd stage of validation (running the debugger for local variables) will be performed as I play the games.

Good luck everyone!!
 
R

rui.rosario

Guest
People, in order to vote please send you votes through PM to me (to make them easier to tally), however do post them in the topic (along with reviews or something else you want to add)
 
Top