~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
※ Danmakufu Q&A/Problem thread 3 ※
<< < (365/366) > >>
BananaCupcakey:
Don't know how to explain this, but I'll try to make it as clear as possible.
1. How to script a trail of straight laser based on random boss movement (rand(n,n)) ? [attach=1]
2. What to script so that the boss can automatically detects and runs into the center of the bullet no matter what position the boss is (directly piercing it) and the bullet will react (like explode etc) [attach=2]
Sparen:

--- Quote from: BananaCupcakey on November 30, 2019, 01:54:55 PM ---Don't know how to explain this, but I'll try to make it as clear as possible.
1. How to script a trail of straight laser based on random boss movement (rand(n,n)) ? [attach=1]
2. What to script so that the boss can automatically detects and runs into the center of the bullet no matter what position the boss is (directly piercing it) and the bullet will react (like explode etc) [attach=2]

--- End quote ---

1. Track the boss's position over two frames to determine its angle with atan2. Then fire a laser in the opposite direction
2. Store the object IDs of the bullets and use atan2 in order to determine the angle between the boss and the bullet. You can use object-object collision, or you can see if a given object is in a radius of another in order to determine when to react.
MugenCC:
I'm having problems rendering transparent images. A grey always appears at the edge of the pictures. Just look at this screenshot.

The mandala in the middle is a purely black transparent image put on top of the rest of the background, but where opaque meets transparent, the grey appears.
Sparen:

--- Quote from: MugenCC on January 05, 2020, 01:59:32 AM ---I'm having problems rendering transparent images. A grey always appears at the edge of the pictures. Just look at this screenshot.

The mandala in the middle is a purely black transparent image put on top of the rest of the background, but where opaque meets transparent, the grey appears.

--- End quote ---

Please provide your code so that we can see your render priorities and blend types. Also provide the raw images so that we can see if there are any notable assumptions that were made when writing the code.
MugenCC:

--- Quote from: Sparen on January 05, 2020, 02:49:29 PM ---Please provide your code so that we can see your render priorities and blend types. Also provide the raw images so that we can see if there are any notable assumptions that were made when writing the code.

--- End quote ---

--- Code: ---        //The object containing the mandala
let BG = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
ObjPrim_SetTexture(BG,current ~ "BG_Pattern.png");
Obj_SetRenderPriorityI(BG,3);

let BG_Glow = ObjPrim_Create(OBJ_SPRITE_LIST_2D);
ObjPrim_SetTexture(BG_Glow,current ~ "BG_Pattern.png");
Obj_SetRenderPriorityI(BG_Glow,3);
ObjRender_SetBlendType(BG_Glow,BLEND_ADD_RGB);

let BGangle = rand(0,45);
let BGphase = rand(0,360);
let BGalpha = 0;

yield;
Intro;

while(bSpell){
ObjSpriteList2D_ClearVertexCount(BG);

ObjSpriteList2D_SetSourceRect(BG,0,0,800,600);
ObjSpriteList2D_SetDestRect(BG,-320,-240,320,240);
ObjRender_SetAlpha(BG,255*BGalpha);
ObjRender_SetAngleZ(BG,0);
ObjRender_SetColor(BG,255,255,255);
ObjRender_SetPosition(BG,320,240,0);
ObjSpriteList2D_AddVertex(BG);
ObjSpriteList2D_SetSourceRect(BG,800,0,1600,600);
ObjSpriteList2D_SetDestRect(BG,-320,-240,320,240);
ObjRender_SetAlpha(BG,255*sin(BGphase/2)^2*BGalpha);
ObjRender_SetPosition(BG,320,240,0);
ObjSpriteList2D_AddVertex(BG);

//Creating the mandala
ObjSpriteList2D_SetSourceRect(BG,853,601,1278,1026);
ObjSpriteList2D_SetDestRect(BG,-213*0.8,-213*0.8,213*0.8,213*0.8);
ObjRender_SetAlpha(BG,255*BGalpha);
ObjRender_SetAngleZ(BG,BGangle);
ObjRender_SetPosition(BG,320,240,0);
ObjSpriteList2D_AddVertex(BG);

ObjSpriteList2D_CloseVertex(BG);
--- End code ---
Navigation
Message Index
Next page
Previous page

Go to full version