if(keyboard_check_pressed(vk_space)){
if(x<room_width/2){
x += (room_width/2-x)*2;
}else if(x>room_width/2){
x -= (x-room_width/2)*2;
}
}
Let me know if this works. Hope this helped.
-Zaddis
Not Telling
31 January 2013 - 11:45 AM
if(keyboard_check_pressed(vk_space)){
if(x<room_width/2){
x += (room_width/2-x)*2;
}else if(x>room_width/2){
x -= (x-room_width/2)*2;
}
}
29 December 2012 - 04:35 AM
28 December 2012 - 06:39 PM
if(file_exists(working_directory+"/score.txt")){
file = file_text_open_read(working_directory+"/score.txt");
hScore = file_text_read_real(file);
file_text_close(file);
}else{
file = file_text_open_write(working_directory+"/score.txt");
file_text_write_real(file, hScore);
file_text_close(file);
}
// Later on writing the new high score to file
if(cScore > hScore){
hScore = cScore;
file = file_text_open_write(working_directory+"/score.txt");
file_text_write_real(file, hScore);
file_text_close(file);
}
26 December 2012 - 04:22 PM
global.Team[n+1].fitness = global.redscore + global.red_bd + global.red_kicks + global.red_db + global.red_fd
global.Team[n+2].fitness = global.bluescore + global.blue_bd + global.blue_kicks + global.blue_db + global.blue_fd
if(global.Team[n+1].fitness > global.Team[n+2].fitness){
redwin = true;
}
if(global.Team[n+1].fitness < global.Team[n+2].fitness){
bluewin = true;
}
26 December 2012 - 03:30 PM
Community Forum Software by IP.Board
Licensed to: YoYo Games Ltd

Find content