Reply to Re: A "high-score" based Dmod
If you don't have an account, just leave the password field blank.
An additional problem is that the touch procedure will constantly run. It's the same as how if you stand on a pillbug, it will constantly damage you. Here the touch procedure will run over and over, and probably interrupt the script when it reaches a wait command in the talk procedure. You could set sp_touch_damage to 0 in touch, but there is a more elegant solution...
BEHOLD! The almighty button brain:
BEHOLD! The almighty button brain:
void main ( void ) { screenlock(1); sp_hard(¤t_sprite, 0); draw_hard_sprite(¤t_sprite); sp_brain(¤t_sprite,14) int &reach } void buttonon { &reach = 1 say("I'm touching the switch", 1); } void buttonoff { &reach = 0 say("watashiwa stopped touching the switch desu",1) } void talk ( void ) { int &num = random(5,1); int &rx = random(600, 0); int &ry = random(400, 0); if (&reach == 1) { if (&num == 1) { sp_pseq(¤t_sprite, 844); sp_pframe(¤t_sprite, 2); playsound(19, 32050,0,0,0); playsound(19, 33000,0,0,0); wait(500); screenlock(0); playsound(43, 22050,0,0,0); say_xy("`3*SCREEN UNLOCKED!!*", 15, 75); &switch += 1; wait(1500); kill_this_task(); } if (&num != 1) { sp_pseq(¤t_sprite, 844); sp_pframe(¤t_sprite, 2); playsound(19, 32050,0,0,0); playsound(19, 33000,0,0,0); sp_hard(¤t_sprite, 1); draw_hard_sprite(¤t_sprite); wait(500); &switch += 1; sp_pseq(¤t_sprite, 844); sp_pframe(¤t_sprite, 1); sp_x(¤t_sprite, &rx); sp_y(¤t_sprite, &ry); sp_hard(¤t_sprite, 0); draw_hard_sprite(¤t_sprite); spawn("give-5g"); } } else { say("I can't reach the switch!", 1); } }