~Hakurei Shrine~ > Rika and Nitori's Garage Experiments

※ Danmakufu Q&A/Problem thread 3 ※

<< < (366/366)

Drake:
Ok so this was a lot more complicated looking at than it had to be because what you provided does not match your previous picture, and is very hard to parse because of how you've set it up as a sprite list. I would recommend against using a sprite list here as you barely seem to be reusing any properties and the background pieces are clearly distinct objects.

The core of the matter is that you're alpha blending the black transparent image but are also resizing it. When the resizing happens you're at the mercy of the scaling algorithm, which in this case works against you. Danmakufu is technically at fault here but you should avoid scenarios like this. You have two good options:
- Resize the image ahead of time (ok if the image is always rendered at full size)
- Invert the image to be white instead and use subtract-blend rendering

Here is an example of what you get with the subtract-blend setup (background then mandala then glowy part):

Dire29:
Hello! So I got back into doing Danmakufu again and I'm almost there with implementing something like Reimu's Yin Yang balls. I managed to have them move into a different position when I press the shift key but they teleport instead:

--- Code: ---if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD){
ObjRender_SetPosition(extrashot, GetPlayerX-10, GetPlayerY-30, 3);
ObjRender_SetPosition(extrashot2, GetPlayerX+10, GetPlayerY-30, 3);

}
else{
ObjRender_SetPosition(extrashot, GetPlayerX-30, GetPlayerY-30, 3);
ObjRender_SetPosition(extrashot2, GetPlayerX+30, GetPlayerY-30, 3);
}
--- End code ---

I know it's because of the SetPosition thing but I'm not sure how to make them NOT teleport. I've tried ObjMove_SetDestAtFrame and other things like that but it doesn't seem to do anything. Is there something else I can try?

Sparen:

--- Quote from: Dire29 on February 22, 2020, 02:02:58 AM ---Hello! So I got back into doing Danmakufu again and I'm almost there with implementing something like Reimu's Yin Yang balls. I managed to have them move into a different position when I press the shift key but they teleport instead:

--- Code: ---if(GetVirtualKeyState(VK_SLOWMOVE)==KEY_PUSH || GetVirtualKeyState(VK_SLOWMOVE)==KEY_HOLD){
ObjRender_SetPosition(extrashot, GetPlayerX-10, GetPlayerY-30, 3);
ObjRender_SetPosition(extrashot2, GetPlayerX+10, GetPlayerY-30, 3);

}
else{
ObjRender_SetPosition(extrashot, GetPlayerX-30, GetPlayerY-30, 3);
ObjRender_SetPosition(extrashot2, GetPlayerX+30, GetPlayerY-30, 3);
}
--- End code ---

I know it's because of the SetPosition thing but I'm not sure how to make them NOT teleport. I've tried ObjMove_SetDestAtFrame and other things like that but it doesn't seem to do anything. Is there something else I can try?

--- End quote ---

I recommend putting their position into variables, and having a 'target'. If they aren't at the target, each frame move the positions closer to the target. The key thing is to do it over multiple frames, while updating the target relative to the player position.

Navigation

[0] Message Index

[*] Previous page

Go to full version