1-- Copyright (C) 2007, 2010 - Bit-Blot 2-- 3-- This file is part of Aquaria. 4-- 5-- Aquaria is free software; you can redistribute it and/or 6-- modify it under the terms of the GNU General Public License 7-- as published by the Free Software Foundation; either version 2 8-- of the License, or (at your option) any later version. 9-- 10-- This program is distributed in the hope that it will be useful, 11-- but WITHOUT ANY WARRANTY; without even the implied warranty of 12-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13-- 14-- See the GNU General Public License for more details. 15-- 16-- You should have received a copy of the GNU General Public License 17-- along with this program; if not, write to the Free Software 18-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20if not v then v = {} end 21if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end 22 23function init(me) 24 node_setCursorActivation(me, true) 25end 26 27function activate(me) 28 local n = getNaija() 29 local node_bg = node_getNearestNode(me, "BG") 30 local node_bgExit = node_getNearestNode(me, "BGEXIT") 31 local sx, sy = entity_getScale(n) 32 entity_switchLayer(n, -3) 33 entity_scale(n, sx*0.5, sy*0.5, 1.5) 34 entity_swimToNode(n, node_bg) 35 entity_watchForPath(n) 36 overrideZoom(0.5, 2) 37 watch(0.5) 38 while (not isLeftMouse()) and (not isRightMouse()) do 39 watch(FRAME_TIME) 40 end 41 entity_scale(n, sx, sy, 1) 42 overrideZoom(1, 1) 43 entity_swimToNode(n, node_bgExit) 44 entity_watchForPath(n) 45 entity_switchLayer(n, 0) 46 --entity_idle(n) 47 overrideZoom(0) 48end 49 50function update(me, dt) 51end 52