Jump to content


oopl.x.beast

Member Since 06 Feb 2012
Offline Last Active Mar 02 2013 01:57 AM

Posts I've Made

In Topic: Making objects 'flip' in room

31 January 2013 - 11:45 AM

You could try doing this...

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

In Topic: EPIC Titles for your games!

29 December 2012 - 04:35 AM

I would greatly appreciate it if you made me a 64x64 avatar. I was thinking of the characters "VS" in blood red with blue-white flames coming out of it. All on a black background. Pretty ambitious, yes, but if you can manage, I'd greatly appreciate it. Thanks for your time! :D

-Zaddis

In Topic: Problem Writing to File

28 December 2012 - 06:39 PM

In your first snippet, you forgot to add "working_directory". The function file_exists() requires the full path, not a relative one. Also, you need to add a backslash after working_directory and before the file's name. Fixed code:

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);
}

Hope this helped.

-Zaddis

In Topic: Having a problem with variables.

26 December 2012 - 04:22 PM

You forgot to use the global prefix in your if statements. Also, you should really use proper coding habits. Fixed code:
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;
}

-Zaddis

In Topic: Phantom Water Tech

26 December 2012 - 03:30 PM

I like it, pbro! :D