[SOLVED] Point and Click + Timer question!
Posted: Fri Dec 07, 2018 7:55 pm
Hello everyone! I'm working on a game that has some point-and-click elements and would like to be able to add a timed feature for it as well so that players will have a limited time to pick and choose what they want to check out. I'm using an imagemap with hotspots that change the cursor when hovered over and, when pressed on, will jump to other labels. Those labels will call the screen again until every hotspot is checked.
When I "show screen countdown," everything works like it should except that the cursor doesn't change when hovering over the hotspots, which is very crucial! I was wondering if there is some way to tweak the code I have to allow the cursor-hover to work when the timer is shown. I'm not even sure why it's not working the way it should. Any help is greatly appreciated!
Please take a look at the code I have for this:
When I "show screen countdown," everything works like it should except that the cursor doesn't change when hovering over the hotspots, which is very crucial! I was wondering if there is some way to tweak the code I have to allow the cursor-hover to work when the timer is shown. I'm not even sure why it's not working the way it should. Any help is greatly appreciated!
Please take a look at the code I have for this:
Code: Select all
define config.mouse = { 'default' : [ ('cursor.png', 0, 0)], 'imagemap' : [ ('qm.png', 0, 0)], 'camera' : [ ('cam_cursor.png', 0, 0)] }
Code: Select all
screen countdown:
zorder 99
timer 0.01 repeat True action If(time > 0, true=SetVariable('time', time - 0.01), false=[Hide('countdown'), Jump(timer_jump)])
style_group "pref"
bar value time range timer_range style "timerbar"
Code: Select all
screen lh_click:
on "hide" action Hide("displayTextScreen")
imagemap:
ground "lh_zoom"
hover "lh_zoom"
hotspot (306, 161, 269, 252) clicked [Return("value"), Jump("look_computers")] mouse "imagemap" #hovered [ Play ("test_two", "sfx/camera_beep.ogg")]
hotspot (109, 481, 255, 173) clicked [Return("value"), Jump("look_table")] mouse "imagemap" #hovered [ Play ("test_two", "sfx/camera_beep.ogg")]
hotspot (304, 0, 374, 74) clicked [Return("value"), Jump("look_lights")] mouse "imagemap" #hovered [ Play ("test_two", "sfx/camera_beep.ogg")]
hotspot (725, 124, 333, 181) clicked [Return("value"), Jump("look_windows")] mouse "imagemap" #hovered [ Play ("test_two", "sfx/camera_beep.ogg")]
Code: Select all
$ time = 4
$ timer_range = 4
$ timer_jump = 'scene1_pt1'
show screen countdown
call screen lh_click
label look_table:
$ check_table = True
"Blah"
if check_computers == True and check_windows == True and check_table == True and check_lights == True:
jump scene1_pt1
else:
call screen lh_click
label look_lights:
$ check_lights = True
"Blah"
if check_computers == True and check_windows == True and check_table == True and check_lights == True:
jump scene1_pt1
else:
call screen lh_click
label look_computers:
$ check_computers = True
"Blah"
if check_computers == True and check_windows == True and check_table == True and check_lights == True:
jump scene1_pt1
else:
call screen lh_click
label look_windows:
$ check_windows = True
"blah"
if check_computers == True and check_windows == True and check_table == True and check_lights == True:
jump scene1_pt1
else:
call screen lh_click
label scene1_pt1:
scene lh
hide screen countdown