below is my code but not work.
I put the below script in the obj that access to a room that I want to player won't be able to come in that room until getting score>30
{
if (score < 30) {io_clear();}
}
Edited by cordakiki, 17 May 2012 - 01:53 AM.
Posted 16 May 2012 - 05:20 AM
Edited by cordakiki, 17 May 2012 - 01:53 AM.
Posted 16 May 2012 - 05:48 AM
Posted 16 May 2012 - 06:05 AM
Posted 16 May 2012 - 07:03 AM
Posted 16 May 2012 - 07:22 AM
{
globalvar weekmark1;
weekmark1 = 0;
var ind,val,num;
message_position(330,475);
for (num=0; num<10; num=num+1)
{
ind = floor(random(30));
val = get_string(question[ind],'');
if (val == answer[ind])
{
show_message('Correct!');
weekmark1 += 20;
//score += 10;
}
else
{show_message('That answer is WRONG!');
weekmark1 += 0;
//score += 0;}
}
message_position(-1,-1);
}
//globalvar weekmark1; draw_text(70,30, 'Your total score is');
draw_set_font(48);
draw_set_halign(fa_center);
draw_text(150,30,weekmark1);
//*Here I have tried to declare the weelmark1 as globalvar here again, or write global.weekmark1 or script1.weekmark1 or weekmark1
the program still cannot run, please helpTAT
Also, below I have problem on showing the message continuously after presiing OK cannot leave the program:
/*if (score == 100) {
show_message('Excellent!');
room_goto_previous(); }
if (score >= 80) && (score< 100){
show_message('Well done!');
room_goto_previous(); }
if (score > 50) && (score <80){
show_message('GOOD!');
room_goto_previous();}
else if (score!=0)
{show_message('Please Try again!');
room_goto_previous();}
*/
Edited by cordakiki, 16 May 2012 - 07:23 AM.
Posted 16 May 2012 - 12:51 PM
First off, you realize that there's [code=auto:0] tags for posting code? It's weird seeing it in the quote box, lol.Thank you so much for reply^ ^
I want the score to be seperate to calculate instead of using the predefined one 'score',
I have error saying that weekmark1 is undefined or cannot find something like that
below is my code in script1
{
globalvar weekmark1;
weekmark1 = 0;
var ind,val,num;
message_position(330,475);
for (num=0; num<10; num=num+1)
{
ind = floor(random(30));
val = get_string(question[ind],'');
if (val == answer[ind])
{
show_message('Correct!');
weekmark1 += 20;
//score += 10;
}
else
{show_message('That answer is WRONG!');
weekmark1 += 0;
//score += 0;}
}
message_position(-1,-1);
}
below I use an object to implement the script as well as draw the score//globalvar weekmark1; draw_text(70,30, 'Your total score is');
draw_set_font(48);
draw_set_halign(fa_center);
draw_text(150,30,weekmark1);
//*Here I have tried to declare the weelmark1 as globalvar here again, or write global.weekmark1 or script1.weekmark1 or weekmark1
the program still cannot run, please helpTAT
Also, below I have problem on showing the message continuously after presiing OK cannot leave the program:
/*if (score == 100) {
show_message('Excellent!');
room_goto_previous(); }
if (score >= 80) && (score< 100){
show_message('Well done!');
room_goto_previous(); }
if (score > 50) && (score <80){
show_message('GOOD!');
room_goto_previous();}
else if (score!=0)
{show_message('Please Try again!');
room_goto_previous();}
*/
Edited by dannyjenn, 16 May 2012 - 12:52 PM.
Posted 16 May 2012 - 01:00 PM
Posted 16 May 2012 - 02:34 PM
Posted 17 May 2012 - 12:20 AM
Posted 17 May 2012 - 04:14 AM
0 members, 0 guests, 0 anonymous users