Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Draggable not working on html version?

A topic by zedsabre created 3 days ago Views: 48 Replies: 2
Viewing posts 1 to 2
(4 edits) (+1)

so i'm trying to do a simple 'drag canvas to area, alert box pops up' like in the Draggables tutorial. however, i want to go to the next card when 'ok' is pressed on the alert box. the code i used was this:

on release do

 if rect.overlaps[me target]

  if alert["pop up message"]

  go["Next"]

  end

 end

end

which worked exactly how i wanted it to in the .deck file. however, when i saved the deck as .html and tried to play that file, it would not proceed to the next card. if you hit 'ok' you simply closed the alert window. is there something i'm missing? 

thanks for the help!

Developer

If alert[] is called with a single string, it has no meaningful result; the only thing a user can do is press "OK".

There is no reason to guard your call to go[] with a conditional.

on release do
 if rect.overlaps[me target]
  alert["pop up message"]
  go["Next"]
 end
end
(+1)

okay, i did try this. for some reason, saving it in html still wouldn't work, even though the deck version worked fine. then i tried saving it as a locked html, and it did work! huh!

thank you for the quick response!