Jump to content


THE_GAME_EDITOR

Member Since 19 Apr 2008
Offline Last Active Jun 14 2013 10:54 AM

Topics I've Started

Dynamic Destroyable Model

29 May 2013 - 12:08 PM

Hello forum,

I'm making it so that in my game the player can create total mayhem to certain structures.

One thing though.. sprite_create_from_surface is really slow. Anyone know a faster alternative?

sprite_delete(spr)
spr=sprite_create_from_surface(global.model_castle,0,0,1203,1573,1,0,0,0);
sprite_index=spr

Yes it is a big sprite.. but even if the computer has to calculate one time, the fps drops at a huge amount. xD

Which is kind of logic.

 

EDIT -

Lol.. this is simply not possible.

I wan't the surface to be bigger as the view size.

And I wan't the surface size to be ridiculously large so I can sale it down 4 or 2 times.

 

EDIT -

Isn't it possible to dynamicly destroy a model. Dynamic model subtraction or something?


Foreground Scrolling Effect. <Solved>

09 May 2013 - 06:49 PM

Hello forum,

Today I'm trying to put more depth in the environment in my game.

What I want to achieve is that effect that limbo does in the game; "shifting the foreground."

This does what I want; "Makes the house go by faster instead of slower (background)":

 

d3d_model_draw(global.model_house01,x-view_xview[0]*0.1,y,0,background_get_texture(bac_apartments_foregr))

 

The only problem with this is the fact that it shifts the object with view_xview according the whole room_width.

This causes the object to get out of position.

So my question is, is there anyone who knows a simple way/trick to shift the object according the width of an object in a view?

 

Thanks for your time and patience to read trough. And thanks in advance! :thumbsup:


Angle Positioning Issue

26 November 2012 - 09:58 PM

Hello forum,
I've made realtime animation for the 2d main character in my game.
With help of thatgamesguy's running man example and the angle difference script.
The problem is not that I dunno how transformation work.. but it's inception. Posted Image
I need a transformation in a transformation in a transformation.

Now here's what i got right now:

d3d_transform_set_identity()
d3d_transform_add_rotation_z(image_angle)
d3d_transform_add_scaling(1,facing,1)
d3d_transform_add_rotation_z(rot4)
d3d_transform_add_translation(0,-4,0)
d3d_transform_add_rotation_z(rot)
d3d_transform_add_translation(x+1,y+yy-.5,0)
draw_sprite_ext(spr_uparm,0,0,0,.25,.25,0,c_white,1)
draw_sprite_ext(spr_loarm,0,7.5,0,.25,.25,rot5,c_white,1)
d3d_transform_set_identity()

d3d_transform_add_rotation_z(image_angle)
d3d_transform_add_scaling(1,facing,1)
d3d_transform_add_rotation_z(180+rot4b)
d3d_transform_add_translation(0,-4,0)
d3d_transform_add_rotation_z(rot)
d3d_transform_add_translation(x+1,y+yy-.5,0)
draw_sprite_ext(spr_uparm,0,0,0,.25,.25,0,c_white,1)
draw_sprite_ext(spr_loarm,0,7.5,0,.25,.25,rot5,c_white,1)
d3d_transform_set_identity()
The image angle is supposed to rotate everything of the main character. Like the whole thing. This because I want to make him sprite tilt on hills. Now almost everything rotate with eachother.
But.. the arms arent attached to the body. And I cant figure out how to do that.
Help is greatly appreciated and I will 10+ your rep. Posted Image

[HTML5] Primitives do not work

19 November 2012 - 08:41 PM

If this is fixed I'll buy the whole thing. Posted Image
Post what would be your reason.

EDIT -
I'm not sure if this is the right place to post this topic.
But I'm just curious about what kind of awesomeness the html5 will bring and what other's their opinion is. Posted Image

Confused about resolution

29 October 2012 - 10:56 AM

Dear forum,
Today i've been searching on the community for a way to make player have full control of the game's resolution.
I think it makes the game more professional and i've seen it in one gamemaker game before.
But I'm kinda confused about how it is supposed to be set up.
Anyway, I've found out that this piece of code is my biggest problem:

if keyboard_check_pressed(ord("P")) persp=!persp

var smallest,largest,zoom_speed;
smallest = 320
largest = 960
zoom_speed=1

if persp=1
{
    if (view_wview[view_current]>smallest) 
    {
    view_wview[view_current]-=(view_wview[view_current]
    /100*zoom_speed)
    view_hview[view_current]-=(view_hview[view_current]
    /100*zoom_speed)
    }
}
else
{
    if (view_wview[view_current]<largest) 
    {
    view_wview[view_current]+=(view_wview[view_current]
    /100*zoom_speed)
    view_hview[view_current]+=(view_hview[view_current]
    /100*zoom_speed)
    }
}


This is how the view dynamically zooms/scales. Now the problem is the largest value. It's value is now 960. Which is correct when using 1920x1080. But when the view is 640x480, it has to be exactly 640.
So this is forcing me to make some kind of calculation.

Does anyone know what calculation solves the value?