Topic: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)  (Read 27620 times)

0 Members and 4 Guests are viewing this topic.

Drake

  • ちゅーを奪えると思ったら…
  • *
  • 君は本当にバカだね。
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #870 on: January 22, 2012, 07:24:01 am »
script_enemy_main{
- includes and variable inits
- script events
- SanaeTask{}
- Moriyashot{
-- ascent{
--- ascent{
--- }
-- }
- }
- loop{
-- ascent{
-- }
- }
} // end of script_enemy_main
setmovepositions
} // -1 brackets
} // -2 brackets
wait{ loop{} }
} // -3 brackets
} // -4 brackets

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander

  • Guest

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #871 on: January 22, 2012, 07:51:17 am »
Few questions:
1. How do I aim bullets to playfield center
2. If I create LaserA, LaserB or LaserC cetrain radius of the enemy:
Code: [Select]
CreateLaserA(1, GetEnemyX+25*cos(dir), GetEnemyY+25*sin(dir), 25);and then change angular velocity in SetLaserDataA, does the laser rotate around the point it was created or aroung the boss with the given radius (25 pixels in this case)

Drake

  • ちゅーを奪えると思ったら…
  • *
  • 君は本当にバカだね。
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #872 on: January 22, 2012, 08:39:12 am »
1. How do I aim bullets to playfield center
atan((240 - bullety) / (224 - bulletx)); or atan2(240 - bullety, 224 - bulletx);

2. If I create LaserA, LaserB or LaserC cetrain radius of the enemy:
Code: [Select]
CreateLaserA(1, GetEnemyX+25*cos(dir), GetEnemyY+25*sin(dir), 25);and then change angular velocity in SetLaserDataA, does the laser rotate around the point it was created or aroung the boss with the given radius (25 pixels in this case)
The laser fires from that point at the angle you specify but it turns at the angvel you specify, so probably "rotate around the point it was created"; but with careful angle planning you can get it to rotate around the boss.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander

Yukari-Chan

  • Unperson
  • *
  • Excuse me while I prepare /your/ demise. <3 TSO
  • LOOK AT ME
  • Nickname: プロジェクト MOKOU
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #873 on: January 22, 2012, 02:19:08 pm »
script_enemy_main{
- includes and variable inits
- script events
- SanaeTask{}
- Moriyashot{
-- ascent{
--- ascent{
--- }
-- }
- }
- loop{
-- ascent{
-- }
- }
} // end of script_enemy_main
setmovepositions
} // -1 brackets
} // -2 brackets
wait{ loop{} }
} // -3 brackets
} // -4 brackets

Oh. What the fuck have I just done. Guess I'll go correct it.
" Borders are Borders. They were meant to be manipulated and mistreated. "

  • Guest

Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #874 on: January 23, 2012, 01:30:59 pm »
Okay then, how do I "kill" (delete and respawn later with sub spawn) a familiar

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
  • Staff
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #875 on: January 23, 2012, 07:03:32 pm »
Okay then, how do I "kill" (delete and respawn later with sub spawn) a familiar
There were two ways.

The first one by giving it SetLife(-5000) or similar, however I believe this counts as a player score, and will add score. The 2nd method without the negative life I forgot and hoping someone can refresh both our memories.
  • Helepolis in Gensokyo

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #876 on: January 23, 2012, 08:13:28 pm »
VanishEnemy will delete the enemy without any additional effects (no score, no explosion).

Helepolis

  • Charisma!
  • *
  • O-ojousama!?
  • Staff
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #877 on: January 23, 2012, 08:21:08 pm »
VanishEnemy will delete the enemy without any additional effects (no score, no explosion).
* Helepolis slaps face

And how could I ever forget about that simple function. ORZ
« Last Edit: January 23, 2012, 08:27:58 pm by Helepolis »
  • Helepolis in Gensokyo

HyperMario

  • The youkai world is in an uproar now.
  • So, I called in the youkai's trump card.
  • Nickname: MiasmaStarbow
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #878 on: January 28, 2012, 02:32:38 am »
INCOMING PROBLEM!!!this must be fit in here, oh well

Here it goes:

http://i314.photobucket.com/albums/ll403/jed9876/Touhou/tojiko_trans.png

So basically, I have a coloring problem. Looks like the 0,0,0 RGB value is transparent on danmakufu. Not just Tojiko, it also includes the shoes of other characters as well. :V
How can I fix this?(using GIMP to recolor it is a mess, it catches the other colors.)

Thanks in advance(derp)

looks like I found a solution on this by myself. I just have to adjust its brightness by 1. Oh silly me.

Anyway, how can I make those . . . what should I call on those. . . timed shots? Something like on Futo's 3rd nonspell, most of Orin's nonspells, and etc.

Sig

kyuu

  • Banned
  • *
  • To the gallows with ye
  • LOOK AT ME
  • Nickname: Mewkyuu
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #879 on: January 28, 2012, 02:51:41 am »
[18:43:16] <HyperMario> you see, the last bullet becomes the first one to move
[18:43:24] <Kyuu> CreateShotA
[18:43:39] <Kyuu> SetShotDataA(id, frametomanipulate, speed, angle.......
[18:43:46] <Kyuu> You would want to play around with frametomanipulate
[18:44:16] <HyperMario> might need a bombard of SetShotDataA's, I guess
[18:44:39] <Kyuu> Certainly it's easy to make.
[18:44:44] <Kyuu> Come to #danmakufu why don't you sometime
[18:45:17] <HyperMario> there's no people in there
[18:45:24] <Kyuu> on ppirc
[18:45:31] <HyperMario> oh
[18:45:43] <Kyuu> it's better than #gensokyo lol
[18:45:52] <HyperMario> maybe I should wait for the answer on the forums
[18:45:56] <Kyuu> i tell you
[18:46:01] <Kyuu> it's setshotdataa
[18:46:18] <HyperMario> I know
[18:46:26] <HyperMario> but I want to reverse the frame
[18:46:30] <Kyuu> uh
[18:46:43] <Kyuu> just have frametomanipulate be lower number every time you shoot
[18:46:58] <HyperMario> as in ascent?
[18:47:10] <Kyuu> suuuuuuuuure
[18:47:15] <Kyuu> lemme try it
[18:47:28] <HyperMario> ok
[18:49:01] <Kyuu> let time = 240;
[18:49:01] <Kyuu> loop(15) {
[18:49:01] <Kyuu>    CreateShotA(0, GetX, GetY, 10);
[18:49:01] <Kyuu>    SetShotDataA(0, 0, 4, GetAngleToPlayer, 0, -4/30, 0, BLUE21);
[18:49:01] <Kyuu>    SetShotDataA(0, time, 0, NULL, 0, 2/45, 2, RED21);
[18:49:01] <Kyuu>    FireShot(0);
[18:49:01] <Kyuu>    time-=15; loop(10){yield;}
[18:49:01] <Kyuu> }
[18:49:02] <Kyuu> try this
[18:49:05] <Kyuu> i didn't test it yet
[18:51:27] <HyperMario> oh cool
[18:51:30] <HyperMario> thanks

Drake

  • ちゅーを奪えると思ったら…
  • *
  • 君は本当にバカだね。
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #880 on: January 28, 2012, 02:55:10 am »
Futo's 3rd nonspell (well, all her nonspells) is basically

ascent(i in 0..number_of_rings){    //
    ascent(j in 0..(360/bullets_in_ring)){
        CreateShotA(0, x, y, delay);
        SetShotDataA(0, 0, speed, 360/j, 0, negative_accel, 0, graphic);
        SetShotDataA(0, frame, NULL, NULL, 0, positive_accel), maxspeed, othergraphic;
        FireShot(0);
    }
    loop(4){yield;}
}


but sometimes the bullets fired last come first which is just like maxwait-(i*frames) and stuff

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander

Mononobe no Futo

  • Dead Nirvana Hermit from Ancient Japan
  • Who art thou?
  • Nickname: Schizophrenia
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #881 on: January 30, 2012, 02:24:00 pm »
Futo's 3rd nonspell (well, all her nonspells) is basically

ascent(i in 0..number_of_rings){    //
    ascent(j in 0..(360/bullets_in_ring)){
        CreateShotA(0, x, y, delay);
        SetShotDataA(0, 0, speed, 360/j, 0, negative_accel, 0, graphic);
        SetShotDataA(0, frame, NULL, NULL, 0, positive_accel), maxspeed, othergraphic;
        FireShot(0);
    }
    loop(4){yield;}
}


but sometimes the bullets fired last come first which is just like maxwait-(i*frames) and stuff

I tried this but only shoots a wave (and is very ugly, doesnt look like the original)... I did something wrong

btw, how I can replicate the Futo 3rd spellcard... the one of the fire? "xxxxxxxx in flames" or something ... looks hard to make

Also, how I can make the Miko's spellcard: Secret Treasure "Armillary Sphere of Ikaruga-dera"? do not even know where to start ^^U
« Last Edit: January 30, 2012, 02:53:38 pm by Mononobe no Futo »

Ginko

  • Nickname: Ginkodono
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #882 on: January 30, 2012, 04:07:49 pm »
Quote
btw, how I can replicate the Futo 3rd spellcard... the one of the fire? "xxxxxxxx in flames" or something ... looks hard to make

Also, how I can make the Miko's spellcard: Secret Treasure "Armillary Sphere of Ikaruga-dera"? do not even know where to start ^^U

Try to understand this if you can for Futo's nonspells (just calling the Shots task, assuming 250 is the id graphic for an arrow) : Corresponding Video
It won't work for you though since it's ph3, but you should be able to understand the task.
Code: [Select]
task Shots{
let a=0;
loop(120){yield;}
loop{
ascent(k in 0..12){ascent(i in 0..20){CustomShotC(GetX,GetY,5,a+360/20*i,-0.08,0,90,0.03,3,0,250);}a=a+0.30*(k+4);loop(5){yield;}}
loop(180){yield}
ascent(k in 0..24){ascent(i in 0..20){CustomShotC(GetX,GetY,5,a+360/20*i,-0.08,0,90,0.03,3,0,250);}a=a+0.40*(k+4);loop(5){yield;}}
loop(180){yield}
ascent(k in 0..12){ascent(i in 0..20){CustomShotC(GetX,GetY,5,a+360/20*i,-0.08,0,150-10*k,0.03,3,0,250);}a=a+0.36*(k+4);loop(5){yield;}}
loop(240){yield}
}
}

task CustomShotC(x,y,s,a,ds,s2,delay,ds2,s3,da,g){
let obj=ObjShot_Create(OBJ_SHOT);
ObjMove_SetPosition(obj,x,y);
ObjShot_SetGraphic(obj,g);
ObjMove_SetAngle(obj,a);
ObjMove_SetSpeed(obj,s);
ObjShot_Regist(obj);
let t=0;
let ph=0;
while(GetLife>0 && !Obj_IsDeleted(obj)){
yield;
if((ds > 0 && ObjMove_GetSpeed(obj)>s2)||(ds < 0 && ObjMove_GetSpeed(obj)<s2)){
ObjMove_SetSpeed(obj,s2);loop(delay){yield;};
CreateShotA2(ObjMove_GetX(obj),ObjMove_GetY(obj),s2,a+da,ds2,s3,g,0);Obj_Delete(obj);
}
ObjMove_SetSpeed(obj,ObjMove_GetSpeed(obj)+ds);
}
Obj_Delete(obj);
}

Futo's  spellcard is very simple, the red fireballs are immobile at first, then accelerate in a random direction, and the yellow fireballs are immobile at first, then move in a increasing angle for each fireball in the column
All you need is a task with two parameters (graphics and angle) and one object shot.

Miko's fourth spellcard is also simple, just make object bullets for which you disable collision, then activate collision and change graphics, the movement is easier with position-controlled bullets.
« Last Edit: January 30, 2012, 06:36:28 pm by Ginko »

Drake

  • ちゅーを奪えると思ったら…
  • *
  • 君は本当にバカだね。
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #883 on: January 30, 2012, 06:51:19 pm »
I tried this but only shoots a wave (and is very ugly, doesnt look like the original)... I did something wrong
I would have been surprised if it had looked anything like the original. This is just the general format of her nonspells; all three of them are made using a similar format. Several rings of bullets fire in some increasing/decreasing offset angle, slow down to a stop, then start moving again, sometimes in a different order. That's all there is there.

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander

Torchic038

  • ...
  • blah
  • Nickname: Torchic0038
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #884 on: January 31, 2012, 05:35:19 pm »
I have a question.
What return and break do?

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #885 on: January 31, 2012, 07:29:16 pm »
I have a question.
What return and break do?
return returns a function value or ends the task. Break exits the loop (wait, loop, etc)

Corresponding Video
lololol Suwako shooting arrows :]
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - TD stage 5 hard perfect with Sanae

  • LiveJournal blog

kyuu

  • Banned
  • *
  • To the gallows with ye
  • LOOK AT ME
  • Nickname: Mewkyuu
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #886 on: January 31, 2012, 08:00:26 pm »
return returns a function value or ends the task.

There are two versions of return.

function funcname(parameters) { dostuff; return value1; }
This does whatever dostuff; does, and then gives a return value of value1. So you can use the above code for things like:
let variable = funcname(parameters);

return when used in like a task: return;
You can use it to exit out of a loop, like break.



Also, ScarletKnives,

Code: (Ginko hates v0.12m so here's a v0.12m version of his ph3 code) [Select]
task Shots{
let a=0;
SetMovePosition02(GetCenterX, GetCenterY/2, 75);
loop(120){yield;}
loop {
ascent(k in 0..12){ascent(i in 0..20){CustomShotC(GetX,GetY,5,a+360/20*i,-0.08,0,90,0.03,3,0,BLUE21);}a=a+0.30*(k+4);loop(5){yield;}}
loop(180){yield}
ascent(k in 0..24){ascent(i in 0..20){CustomShotC(GetX,GetY,5,a+360/20*i,-0.08,0,90,0.03,3,0,BLUE21);}a=a+0.40*(k+4);loop(5){yield;}}
loop(180){yield}
ascent(k in 0..12){ascent(i in 0..20){CustomShotC(GetX,GetY,5,a+360/20*i,-0.08,0,150-10*k,0.03,3,0,BLUE21);}a=a+0.36*(k+4);loop(5){yield;}}
loop(240){yield}
}
}

task CustomShotC(x,y,s,a,ds,s2,delay,ds2,s3,da,g){
let obj=Obj_Create(OBJ_SHOT);
Obj_SetPosition(obj,x,y);
ObjShot_SetGraphic(obj,g);
Obj_SetAngle(obj,a);
Obj_SetSpeed(obj,s);
let t=0;
let ph=0;
while(!Obj_BeDeleted(obj)){
yield;
if((ds > 0 && Obj_GetSpeed(obj)>s2)||(ds < 0 && Obj_GetSpeed(obj)<s2)){
Obj_SetSpeed(obj,s2); loop(delay){yield;}
CreateShot02(Obj_GetX(obj),Obj_GetY(obj),s2,a+da,ds2,s3,g,0); Obj_Delete(obj);
}
Obj_SetSpeed(obj,Obj_GetSpeed(obj)+ds);
}
}
« Last Edit: February 01, 2012, 12:29:26 am by kyuu »

Sammythebat

  • Nickname: SammyBat
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #887 on: February 02, 2012, 11:40:49 pm »
I forgot the formula for calculating radius, for example I'd need it to check if an item is within a radius surrounding the character so that the item will be automatically auto route to the player.

I was wondering if anyone else uses or remembers the radius/circle collission detection formula

Drake

  • ちゅーを奪えると思ったら…
  • *
  • 君は本当にバカだね。
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #888 on: February 03, 2012, 01:10:37 am »
Common method is just checking distance, which naturally equates to a radius.

((oy-py)^2 + (ox-px)^2) < (distance^2)

of course there are methods to speed this stuff up though but yeah

A Colorful Calculating Creative and Cuddly Crafty Callipygous Clever Commander

HyperMario

  • The youkai world is in an uproar now.
  • So, I called in the youkai's trump card.
  • Nickname: MiasmaStarbow
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #889 on: February 10, 2012, 04:32:16 am »
Is there a way on how to play 2 sounds?

Let's say: PlaySE(Laser) will play Laser1 and Laser2

is that possible?

Sig

JmLyan

  • Nickname: Lyan
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #890 on: February 10, 2012, 12:16:21 pm »
Is there a way on how to play 2 sounds?

Let's say: PlaySE(Laser) will play Laser1 and Laser2

is that possible?

Why not just play them at the same time?

Ginko

  • Nickname: Ginkodono
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #891 on: February 10, 2012, 01:32:56 pm »
Or just create a function ...

Sammythebat

  • Nickname: SammyBat
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #892 on: February 10, 2012, 05:54:46 pm »
Is there a way to create gravity bullets using CreateShot02? I remember seeing something like that a long time ago. It's that my stage 3 boss's gimmick bullets make heavy use of gravity bullets when they explode.

MMX

  • In Soviet Gensokyo...
  • ...bullets dodge you.
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #893 on: February 10, 2012, 09:38:12 pm »
Is there a way to create gravity bullets using CreateShot02? I remember seeing something like that a long time ago. It's that my stage 3 boss's gimmick bullets make heavy use of gravity bullets when they explode.
here i've answered the same question. And here is a test script i made.
My danmakufu thread Most recent - "Kappa Mechanics" (Nitori fight)   My youtube channel Latest update - TD stage 5 hard perfect with Sanae

  • LiveJournal blog

Koishi Komeiji

  • Bandodging is fun!
  • *
  • You really think we wouldn't notice?
  • LOOK AT ME
  • Nickname: Misses Lovable
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #894 on: February 11, 2012, 12:10:03 am »
What does ceil do? Just wondering.
An Artist. Expect a thread at "AAA" soon!

Naut

  • Shrine Janitor
  • *
  • LOOK AT ME
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #895 on: February 11, 2012, 01:08:37 am »
Rounds up always.

ceil(1.7) = 2
ceil(1) = 1
ceil(1.1) = 2
<Bananamatic> I can't like this game
<Bananamatic> it's impossible
<eb> only naut likes ufo
<eb> of course you can't like it, he's hoarding all the liking
  • YouTube Account

Koishi Komeiji

  • Bandodging is fun!
  • *
  • You really think we wouldn't notice?
  • LOOK AT ME
  • Nickname: Misses Lovable
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #896 on: February 11, 2012, 01:15:20 am »
Thanks, Naut!
An Artist. Expect a thread at "AAA" soon!

Teff007

  • Recovery "Heal by Desire"
  • Yoshika Miyako!!
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #897 on: February 11, 2012, 09:06:31 pm »
How to replicate the effect of Yukari's "Border between Humans and Youkai"?

At the Final Phase, all the lasers close towards the player. I want to do the same.

My current code is this:

Code: [Select]
let dir = 0;
let dir2 = 0;
let dir3 = 180;

wait(60);

loop
{
CreateShot01(GetX + dir3 * cos(dir), GetY + dir3 * sin(dir), 1, dir - 180, 14, 10);
CreateShot01(GetX - dir3 * cos(dir), GetY - dir3 * sin(dir), 1, dir - 180, 14, 10);
CreateShot01(GetX + dir3 * cos(dir2), GetY + dir3 * sin(dir2), 1, dir2 - 180, 14, 10);
CreateShot01(GetX - dir3 * cos(dir2), GetY - dir3 * sin(dir2), 1, dir2 - 180, 14, 10);
dir++;
dir2--;
dir3--;
wait(1);
}

Code may be wrong, as I type this from memory
Working on a Full Touhou Game. (30% to Demo)
(All Girls Cuts Finished, Playable Girls finished, Working on Playable Girls Cuts (Remake))
Youmu Shadow:  http://i43.tinypic.com/htgymh.jpg
Marisa Shadow: http://i44.tinypic.com/iqyihe.jpg
  • Youtube Channel

xForeverFanaticx

  • Bomb ALL the Spellcards!
  • Nickname: Ventus
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #898 on: February 12, 2012, 04:29:51 am »
Quick question on reflecting things: How would you reflect objects in a circle? As in, if a circle's center is on point X and Y, and an object bullet reached a certain distance R from the center point, what's the basic formula for bouncing them? I know that on the vertical walls it's 180-angle, while it's 360-angle for the horizontal walls... :\

<><><><>360<><><><>
 180<><><><><><>180
<><><><>360<><><><>

...180 between each 90 degree increment :\

set angle to Angle-Bullet, where Angle is the angle from X and Y, and Bullet is the trajectory of the bullet?

only i'd have to change Angle to accomodate the formula? like, Angle=2*(Angle-180)+180?

...I'm testing this on paper as I'm typing it, and it looks promising :\ Dunno yet. What I has is:

let Bullet=Obj_GetAngle(obj); //(irrelevant in real script situations probably, just using it for simpler show)
let Angle=atan2(Obj_GetY(obj)-GetCenterY,Obj_GetX(obj)-GetCenterX);
Angle=2*(Angle-180)+180; //(this is how I'm thinking of accommodating the angle calculation thing, where its 360 up and down, and 180 left and right)
SetAngle(obj,Angle-Bullet); //(final thing, basically how a reflected angle is determined)

Starting to think asking this was redundant since I've probably figured it out by now. Oh well. Test it in the morning I guess...

Another thing, I've been thinking about the hitbox thing endlessly again, and I still don't see how a bubble bullet can have such a small hitbox compared to the sprite when it was stated that a custom sprite's hitbox radius is about 1/2 to 1/3 of the rectangle's smallest dimension. If you put the borders right up close to the bubble's edges, that would make the sprite almost all hitbox, right? And if it were larger, wouldn't it make it larger than the sprite itself? Or am I confusing myself...? O.o

Ginko

  • Nickname: Ginkodono
Re: ※ Q&A/Problem Thread 5 ※ for OLD Danmakufu version (0.12m)
« Reply #899 on: February 12, 2012, 09:35:31 am »
Quote
Another thing, I've been thinking about the hitbox thing endlessly again, and I still don't see how a bubble bullet can have such a small hitbox compared to the sprite when it was stated that a custom sprite's hitbox radius is about 1/2 to 1/3 of the rectangle's smallest dimension. If you put the borders right up close to the bubble's edges, that would make the sprite almost all hitbox, right? And if it were larger, wouldn't it make it larger than the sprite itself? Or am I confusing myself...? O.o

Yeah, it's not the radius but the diameter. If your bullet definition borders match the sprite's borders, only half the radius of the bullet will be deadly.


If a bullet hits your circle at (X+R*cos(u),Y+R*sin(u)) and that bullet has angle v, it will bounce with angle 2*u-v.

You can put 2*(u-180)-v, or 2*(u-900)-v if you like that, though :°).
 

SMF 2.0.1 | SMF © 2011, Simple Machines
Theme based on ModernDark64 design by BlocWeb
Page created in 0.212 seconds with 14 queries.