fix hokey pokey menu
the menu eases in, the menu eases out, the menu eases in and you shake it all about
This commit is contained in:
		| @@ -185,7 +185,7 @@ function call_move(x) | ||||
| end | ||||
|  | ||||
| function updategame() | ||||
|  if (primary_ship.xp >= primary_ship.xptarget) and (lframe - primary_ship.last_xp_frame > 0x0.000f) then | ||||
|  if (primary_ship.xp >= primary_ship.xptarget) and (lframe - primary_ship.last_xp_frame > 0x0.000f) and (not primary_ship.dead) then | ||||
|   mode = rearm_mode.new() | ||||
|   return _update60() | ||||
|  end | ||||
| @@ -1766,6 +1766,7 @@ rearm_mode = mknew{ | ||||
|  crt_frm = 1, | ||||
|  pos=-1, | ||||
|  init=function(this) | ||||
|   poke(0x5f5c, 255) --no btnp repeat | ||||
|   rearm_mode.shuffle(this) | ||||
|  end, | ||||
| } | ||||
| @@ -1858,21 +1859,22 @@ function rearm_mode:update_pos() | ||||
|  if (not pos) return | ||||
|  if (pos == 0) then | ||||
|   if (primary_ship.xp < primary_ship.xptarget) self.pos = 1 | ||||
|   xpwhoosh = nil | ||||
|   return | ||||
|  end | ||||
|  if (pos < 0) pos = min(pos + 0x0.05, 0) | ||||
|  if pos > 0 then | ||||
|   pos -= 0x0.1 | ||||
|   if (pos <= 0) pos = nil | ||||
|   if (pos <= 0) pos = 999 | ||||
|  end | ||||
|  self.pos = pos | ||||
| end | ||||
|  | ||||
| function rearm_mode:update() | ||||
|  self:update_pos() | ||||
|  if not self.pos then | ||||
|  if self.pos > 1 then | ||||
|   mode = game_mode | ||||
|   return _update60() | ||||
|   return  -- do not advance frame | ||||
|  end | ||||
|  local sel, bfm = self.sel, self.bfm | ||||
|  if (btn(3) and sel > 0 or btn(2) and sel < 0) sel=-sel | ||||
| @@ -1892,7 +1894,7 @@ function rearm_mode:update() | ||||
|    -- todo: sound: rearm | ||||
|    primary_ship.shield = primary_ship.maxshield | ||||
|    -- todo: rewrite for three guns | ||||
|    if (primary_ship.spec_gun) primary_ship.spec_gun.ammo = primary_ship.spec_gun.max_ammo | ||||
|    if (primary_ship.special_gun) primary_ship.special_gun.ammo = primary_ship.special_gun.max_ammo | ||||
|    primary_ship.hp = min(primary_ship.maxhp, primary_ship.hp + primary_ship.maxhp/2) | ||||
|    primary_ship.xp -= primary_ship.xptarget / 2 | ||||
|   else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user