Fangames > Engines

I Wanna Be The Studio Engine YoYoYo Edition

<< < (2/21) > >>

YoYoYoDude1:

--- Quote from: Archee on August 24, 2015, 02:15:39 PM ---Hey, you've made a massive work. That's really awesome.
Do you need any help, by the way, to create the engine faster? I've made a simple pause, it works pretty well, I think. If you like it, I can post a diff with version 0.5 here. :)

Edit: found a bug, when you can't complete the game on impossible mode, because objGameEnd doesn't save you and there's no savepoints in the end room.

--- End quote ---
Oh yeah sure, I'd like to see how you implemented the pausing. I tried a couple different methods but nothing worked as well as I wanted it to.
And thanks for letting me know about the objGameEnd thing. I'll just make it so that it autosaves you when you touch it.

Archee:
Well, there's too many shitty changes I've made, so I'm just going to explain how I've made it insteat of posting it here.

Changed code is this:

--- Code: ---if (keyboard_check_pressed(global.pausebutton) && !global.noPause) {
    global.pause = !global.pause;
    if( global.pause ) {
        instance_deactivate_all(true);
        surface_copy(global.pause_surf,0,0,application_surface);
    } else {
        instance_activate_all();
    }
}
--- End code ---

So, I'm making a pause surface at the start of the game in variable initialization script and added a clear memory script to delete it if you press F2, but it'd be much better to not restart the game and ust move to the title again, because it does the same work all over again if you restart game. It'd be harder to make, I think, I didn't look into the whole code. Also, you need to add a check for a pause to not to increment time while paused. Oh, and I almost forgot to post draw GUI code of objWorld:

--- Code: ---var str, off, th, tm, ts;

if(global.pause) {
    draw_clear(c_black);
    draw_surface_ext(global.pause_surf,0,0,1,1,0,c_white,0.5);
    draw_set_color(c_white); //Font color
    th = floor(global.time/(60*60));
    tm = floor((global.time/60) mod 60);
    ts = floor(global.time mod 60);
    str = "Time: "+string(th)+":"+string(tm)+":"+string(ts);
    off = view_hview - string_height(str)-8;
    draw_text(8+string_width(str)/2,off,str);
    str = "Deaths: " + string(global.death);
    off = off - string_height(str)-8;
    draw_text(8+string_width(str)/2,off,str);
   
    str = "PAUSE";
    draw_text(view_wview/2,view_hview/2,str);
}
--- End code ---

Offsets maybe broken a bit, I've expected it to be drawn from a top-left corner and not from a center.

YoYoYoDude1:

--- Quote from: Archee on August 25, 2015, 06:22:30 PM ---Well, there's too many shitty changes I've made, so I'm just going to explain how I've made it insteat of posting it here.

Changed code is this:

--- Code: ---if (keyboard_check_pressed(global.pausebutton) && !global.noPause) {
    global.pause = !global.pause;
    if( global.pause ) {
        instance_deactivate_all(true);
        surface_copy(global.pause_surf,0,0,application_surface);
    } else {
        instance_activate_all();
    }
}
--- End code ---

--- End quote ---
Oh awesome, thanks! I didn't realize you could copy the application surface like that. That's a pretty good way of doing the pausing.
Anyway, I just updated the original post with version 0.6 of the engine that has the pause screen implemented and a very other misc fixes/changes.

Archee:
Sometimes vines are not working (the right one), I wasn't able to reproduce it again. I guess if this is a mistake that causes the bug:

--- Code: ---if (distance_to_object(objWalljumpL) < 2 && place_free(x,y+(global.grav)))
...
if (distance_to_object(objWalljumpR) == 1 && place_free(x,y+(global.grav)))
--- End code ---

Edit: I got it, it's because of slip blocks which make player coordinates being changed to something like N + 0.5 exactly, works with everything else. Changing == 1 to < 2 seems fixing it.

YoYoYoDude1:

--- Quote from: Archee on August 27, 2015, 04:33:23 AM ---Sometimes vines are not working (the right one), I wasn't able to reproduce it again. I guess if this is a mistake that causes the bug:

--- Code: ---if (distance_to_object(objWalljumpL) < 2 && place_free(x,y+(global.grav)))
...
if (distance_to_object(objWalljumpR) == 1 && place_free(x,y+(global.grav)))
--- End code ---

Edit: I got it, it's because of slip blocks which make player coordinates being changed to something like N + 0.5 exactly, works with everything else. Changing == 1 to < 2 seems fixing it.

--- End quote ---
Based sub-pixels causing another bug. Thanks for letting me know, just uploaded a fix.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version