[SOLVED] -- Load and Unload collection proxies to avoid overlap

Thank you sir for giving me the solution…i actually fixed it right now,…i put the
msg.post(".", “acquire_input_focus”) in the function_init(self) and it works well…there’s also a plenty of problems that i had encountered last time but i actually fixed it by myself (and i actually cant believe it, thanks for all the solution and explanations that you gave to me, i think i’m improving little by little… ) my game runs in its right game flow…and…uhm…hehe…one question…remember when i said that i need to find a solution to remove/unload stage 1 whenever stage 2 show in the screen?..actually,…i didn’t find a right solution on this.,…so i just wanna ask you if
msg.post(“main:/nextlevel#level_1”, “unload”) is the right code that i need just to remove stage 1 on screen so that it will not overlap to stage 2?..if yes, where do i need to put it?..waiting for you response…thanks! :’)

  • I add a GO directly in the outline of level1.collection…i named it “fl” …inside of it,…i put a sprite, collisionobject (set to kinematic, group to finish and mask to hero)…i also create and put a script file named “controller1.script” on the GO…inside of the script, i add the following code:

function init(self)

self.collected = false

end

function on_message(self, message_id, message, sender)

if self.collected == false and message_id == hash("collision_response") then
self.collected = true
msg.post("#sprite", "disable")
msg.post("main:/nextlevel#level_2", "load")

elseif message_id == hash(“proxy_loaded”) then
– New world is loaded. Init and enable it.
msg.post(sender, “init”)
msg.post(sender, “enable”)

end

end
  • i did it coz i want my hero to loads and enable stage 2 whenever i managed to finish stage 1…but when i tried to launch the game, stage2 actually loads perfectly but stage 1 overlaps on it…
1 Like