diff --git a/LivingDexSS.gmx/LivingDexSS.project.gmx b/LivingDexSS.gmx/LivingDexSS.project.gmx index dce186f..be5fddb 100644 --- a/LivingDexSS.gmx/LivingDexSS.project.gmx +++ b/LivingDexSS.gmx/LivingDexSS.project.gmx @@ -39880,6 +39880,8 @@ + + objects\obj_global diff --git a/LivingDexSS.gmx/objects/obj_global.object.gmx b/LivingDexSS.gmx/objects/obj_global.object.gmx index ac9460b..3bf53ef 100644 --- a/LivingDexSS.gmx/objects/obj_global.object.gmx +++ b/LivingDexSS.gmx/objects/obj_global.object.gmx @@ -87,6 +87,9 @@ global.selected[dex.own] = 0; global.dex_len = array_height_2d(global.dexdata); global.hud_pokemon_rate = 0.225; + +global.mouse_x_prev = mouse_x; +global.mouse_y_prev = mouse_x; @@ -188,6 +191,10 @@ for (global.box_count=1; global.current<global.dex_len; global.box_count++) slot_x = j; slot_y = i; + plus_x = 0; + plus_y = 0; + spr_plus = 1; + show_debug_message("Spawned #"+dexno+" "+pokemon+" "+form+"."); } @@ -240,6 +247,59 @@ for (global.box_count=1; global.current<global.dex_len; global.box_count++) + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + // UPDATE PREVIOUS MOUSE POSITIONS + +global.mouse_x_prev = mouse_x; +global.mouse_y_prev = mouse_y; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + /// MOUSE SPEED & DIRECTION +global.mouse_dir_x = mouse_x-global.mouse_x_prev; +global.mouse_dir_y = mouse_y-global.mouse_y_prev; + +show_debug_message("("+string(global.mouse_dir_x)+","+string(global.mouse_dir_y)+")"); + + + + + 1 diff --git a/LivingDexSS.gmx/objects/obj_slot.object.gmx b/LivingDexSS.gmx/objects/obj_slot.object.gmx index 906ee52..67acbb9 100644 --- a/LivingDexSS.gmx/objects/obj_slot.object.gmx +++ b/LivingDexSS.gmx/objects/obj_slot.object.gmx @@ -87,6 +87,8 @@ color = get_color3(own, true); 1 /// CLICKEDY CLICK +spr_plus = 1; + if (++own >= 3) own = 0; @@ -106,6 +108,29 @@ if (file_exists("save.ini")) } else show_debug_message("ERROR: Save file somehow went missing."); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + spr_plus = 0.75; @@ -133,20 +158,23 @@ else //image_yscale = global.icon_scale; -// Back color +/// DRAW + +// Slot + Color + draw_set_color(color); draw_rectangle(x+1, y+1, x+global.box_scale-1, y+global.box_scale-1, false); draw_set_color(c_white); -//draw_self(); -//draw_sprite_stretched(sprite_index, 0, x, y, global.box_len, global.box_len); draw_self(); + // Sprite + +sprite_wiggly(); + if (spr != -1) - draw_sprite_ext(spr, 0, x+global.box_scale/2, y+global.box_scale/2, global.icon_scale, global.icon_scale, image_angle, image_blend, image_alpha); - - //draw_sprite(spr, 0, x+global.box_len/2, y+global.box_len/2); + draw_sprite_ext(spr, 0, x+global.box_scale/2+plus_x, y+global.box_scale/2+plus_y, global.icon_scale*spr_plus, global.icon_scale*spr_plus, image_angle, image_blend, image_alpha); diff --git a/LivingDexSS.gmx/scripts/sprite_wiggly.gml b/LivingDexSS.gmx/scripts/sprite_wiggly.gml new file mode 100644 index 0000000..734161b --- /dev/null +++ b/LivingDexSS.gmx/scripts/sprite_wiggly.gml @@ -0,0 +1,28 @@ +///sprite_wiggly() >> returns extra + +/// Mouse Speed & Direction +//var mouse_dir_x = + +var st_x = x+(19*global.icon_scale); +var st_y = y+(14*global.icon_scale); + +if (point_distance(st_x, st_y, mouse_x, mouse_y) <= 20*global.icon_scale) +{ + if (global.mouse_dir_x !=0) + plus_x += global.mouse_dir_x/8 + else + plus_x += (st_x-(st_x+plus_x))/room_speed*2; + + if (global.mouse_dir_y !=0) + plus_y += global.mouse_dir_y/8 + else + plus_y += (st_y-(st_y+plus_y))/room_speed*2; +} +else +{ + plus_x += (st_x-(st_x+plus_x))/room_speed*8; + plus_y += (st_y-(st_y+plus_y))/room_speed*8; +} + + + diff --git a/LivingDexSS.gmx/scripts/sprite_wiggly_old.gml b/LivingDexSS.gmx/scripts/sprite_wiggly_old.gml new file mode 100644 index 0000000..cfc04fa --- /dev/null +++ b/LivingDexSS.gmx/scripts/sprite_wiggly_old.gml @@ -0,0 +1,18 @@ +///sprite_wiggly() >> returns extra + + + +var st_x = x+(19*global.icon_scale); +var st_y = y+(14*global.icon_scale); + +if (point_distance(st_x, st_y, mouse_x, mouse_y) <= 19*global.icon_scale) +{ + plus_x += (mouse_x-(st_x+plus_x))/room_speed*4; + plus_y += (mouse_y-(st_y+plus_y))/room_speed*4; + show_debug_message(point_distance(st_x, st_y, mouse_x, mouse_y)) +} +else +{ + plus_x += (st_x-(st_x+plus_x))/room_speed*2; + plus_y += (st_y-(st_y+plus_y))/room_speed*2; +}