Author Topic: Blargel's Danmakufu Corner (Ikareimu Revival? and Contest)  (Read 61345 times)

Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #150 on: April 08, 2010, 12:05:42 PM »
Tested it... WRIGGLE KICK
So yeah... still waiting for the comments to be implied, as well as (un)locking of levels.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #151 on: April 08, 2010, 12:14:46 PM »
Already now I am able to tell: You are a god.
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

ChaoStar

  • Dark History Boy
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #152 on: April 08, 2010, 12:30:17 PM »
Already now I am able to tell: You are a god.

Pity he can't sprite, make music, or draw :V

because if he could...

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #153 on: April 08, 2010, 01:12:12 PM »
I finally got some documentation that should be enough to get most task-oriented scripters able to work on their stuff. The other sections will go up later. Also just as a heads up, the speed of the camera charging in both unfocused and superfocused mode will be increased in the next release. The one in this version, WonderfulLife pointed out was too slow.

Tested it... WRIGGLE KICK
So yeah... still waiting for the comments to be implied, as well as (un)locking of levels.
That won't be for a while. The next release is going to include functions like CreateStbShot01, CreateStbShot02, CreateStbShot11, CreateStbShot12, and laser creation. It will also (finally) have sound effects in the menu and for Aya.

Already now I am able to tell: You are a god.
Quick, give me faith before I die!

Pity he can't sprite, make music, or draw :V

because if he could...
I can play music...  :ohdear:
« Last Edit: April 08, 2010, 01:23:36 PM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Iryan

  • Ph?nglui mglw?nafh
  • Cat R?lyeh wgah?nagl fhtagn.
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #154 on: April 08, 2010, 02:28:28 PM »
Pity he can't sprite, make music, or draw :V

because if he could...
Quote
he can't make music

Shun the nonbeliever! Shuuuuuuuuuun!
« Last Edit: April 08, 2010, 02:39:55 PM by Iryan »
Old Danmakufu stuff can be found here!

"As the size of an explosion increases, the numbers of social situations it is incapable of solving approaches zero."

Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #155 on: April 08, 2010, 05:37:41 PM »
Quote

!   C:UsersBrandonDocumentsDownloadsPhotography (1).rar: CRC failed in Photographysoundgmgm5.mp3. The file is corrupt
!   C:UsersBrandonDocumentsDownloadsPhotography (1).rar: Unexpected end of archive
:X

Garlyle

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #156 on: April 08, 2010, 05:39:22 PM »
:X
How do people not know this error?  It means that your download got screwed up and cut off early.  Delete it and go redownload.

Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #157 on: April 08, 2010, 05:47:39 PM »
How do people not know this error?  It means that your download got screwed up and cut off early.  Delete it and go redownload.


pffffff I know that! Thats why I posted it! I've redownloaded it 6 times!

ChaoStar

  • Dark History Boy
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #158 on: April 08, 2010, 05:53:01 PM »

pffffff I know that! Thats why I posted it! I've redownloaded it 6 times!

If you want to wait, I'll mirror it for you. That might help.

Garlyle

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #159 on: April 08, 2010, 07:22:58 PM »
Mirroring might be a good idea because I could download it just fine.

Erm, on another note though... I can't -run- it just fine.  I tried going through the music room, selected Wind Tour... and my computer froze.  Not just for a short time, not just Danmakufu... I literally had to force power-off my comptuer.  I was able to replicate this glitch, so... it wasn't just an accidental thing.  I don't know what's going on but I'm not going to restart my computer again to test out if it freezes up on other songs.

On the other hand, everything else seems to work fine 8D Can I possibly suggest making the Nice Shot window customizable in some way?  I know in some StB scenes, it doesn't reach the full 2x score bonus possible, while in others it does.

ChaoStar

  • Dark History Boy
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #160 on: April 08, 2010, 07:56:55 PM »
Mirroring might be a good idea because I could download it just fine.

Erm, on another note though... I can't -run- it just fine.  I tried going through the music room, selected Wind Tour... and my computer froze.  Not just for a short time, not just Danmakufu... I literally had to force power-off my comptuer.  I was able to replicate this glitch, so... it wasn't just an accidental thing.  I don't know what's going on but I'm not going to restart my computer again to test out if it freezes up on other songs.

On the other hand, everything else seems to work fine 8D Can I possibly suggest making the Nice Shot window customizable in some way?  I know in some StB scenes, it doesn't reach the full 2x score bonus possible, while in others it does.

Well, weird problem. It works perfecto for me! D:

Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #161 on: April 08, 2010, 08:53:03 PM »
If you want to wait, I'll mirror it for you. That might help.


Could you please? and Thank you!

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #162 on: April 08, 2010, 10:22:50 PM »
Mirroring might be a good idea because I could download it just fine.

Erm, on another note though... I can't -run- it just fine.  I tried going through the music room, selected Wind Tour... and my computer froze.  Not just for a short time, not just Danmakufu... I literally had to force power-off my comptuer.  I was able to replicate this glitch, so... it wasn't just an accidental thing.  I don't know what's going on but I'm not going to restart my computer again to test out if it freezes up on other songs.

On the other hand, everything else seems to work fine 8D Can I possibly suggest making the Nice Shot window customizable in some way?  I know in some StB scenes, it doesn't reach the full 2x score bonus possible, while in others it does.

FFFFFFF More random ass glitches that actually mess up more than Danmakufu!? Anyone else having this problem? :S

Also in StB, Nice Shot maxes out at 1.5 multiplier if you manage to time it almost perfectly and always gets you at least 1.2 for all scenes. As far as I could tell, the window of opportunity is about the same for all scenes as well. If you can point me to a scene that doesn't fit this, I'll go ahead and change it.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

ChaoStar

  • Dark History Boy

MCXD

  • Test
  • Light Sign "Heaven Engine"
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #164 on: April 08, 2010, 11:35:13 PM »
I have no idea how many things you are aware of, but I may as well list all the little aesthetic things which are still missing:

- Comments, although implemented in-program, aren't implemented in the GUI yet.
- Nothing to indicate which scenes are beaten.
- No unlocking system yet.
- Nothing to save high-scores, or for that matter, best shots.
- No 'attempts' counter. Hell, lets just say that you're lacking a lot of things on the stage select screen *shot*
- Nothing to save replays (I'm pretty sure this is impossible anyway. Thanks, DMF.)
- No running (high)score display in the top left during gameplay.
- No stage number or text photo count in the top right of the screen during game play.
- Aya doesn't have a visible hit-box. (She's supposed to when she focuses.)
- No DS features as of yet, like tilted pictures and orientation switching.

:V

So anyway, this is actually really awesome. I've already began messing around with it and making mock spell-cards, hopefully for perhaps a little project in future. This has only made me more excited. Keep up the excellent work!

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #165 on: April 09, 2010, 12:11:21 AM »
I have no idea how many things you are aware of, but I may as well list all the little aesthetic things which are still missing:

- Comments, although implemented in-program, aren't implemented in the GUI yet.
- Nothing to indicate which scenes are beaten.
- No unlocking system yet.
- Nothing to save high-scores, or for that matter, best shots.
- No 'attempts' counter. Hell, lets just say that you're lacking a lot of things on the stage select screen *shot*
- Nothing to save replays (I'm pretty sure this is impossible anyway. Thanks, DMF.)
- No running (high)score display in the top left during gameplay.
- No stage number or text photo count in the top right of the screen during game play.
- Aya doesn't have a visible hit-box. (She's supposed to when she focuses.)
- No DS features as of yet, like tilted pictures and orientation switching.

:V

So anyway, this is actually really awesome. I've already began messing around with it and making mock spell-cards, hopefully for perhaps a little project in future. This has only made me more excited. Keep up the excellent work!

I pretty much know all that except for the hitbox thing. Totally forgot about Aya's hitbox.  :ohdear: As for the rest of the scene select menu. Pretty much all of it is impossible until I get around to saving data into common data files to keep track of every scene's score and clear status. Aya's comments, best shots, attempted photos and all that other good stuff would be heavily dependent on those after all.

The introduction page of my documentation lists all the things that aren't implemented yet so you might want to take a look before getting too into it.

Erm, on another note though... I can't -run- it just fine.  I tried going through the music room, selected Wind Tour... and my computer froze.  Not just for a short time, not just Danmakufu... I literally had to force power-off my comptuer.  I was able to replicate this glitch, so... it wasn't just an accidental thing.  I don't know what's going on but I'm not going to restart my computer again to test out if it freezes up on other songs.

I believe I know what the problem is. It is likely a similar problem to the first crashing issue so if you've experienced crashing in the previously released version, the music room is not a good place to explore as of this version. The issue is with how the lines of text are drawn. In some of the descriptions, there are lines with no text on them and when the effect objects that take those lines tries to calculate how many vertices to create, they create 0. Creating an effect with less than 3 vertices will invariably cause certain graphics cards to perform strangely and crash the whole computer -- not just Danmakufu. I'll have this fixed in the next version.
« Last Edit: April 09, 2010, 07:42:31 AM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #166 on: April 12, 2010, 05:58:30 AM »
More optimization,  more sacrifices. This one is related to the previous sacrifice I had to make for optimization, by which I mean it's related to shot delay. It's not too big of a change, but it IS inconvenient, and so I'm letting everyone know ahead of time.

Right now, when you want to delay a bullet and show a delay effect, you have write something like this:
CreateStbDelay(GetX, GetY, YELLOW, 10);  //Delay effect lasting 10 frames.
ObjStbShot_Initialize(GetX, GetY, 3, GetAngleToPlayer, YELLOW01, 10, 30, 8, YELLOW); //Delay set at 10 frames.


That is, you have to manually draw the delay for whatever frames and set the delay of the bullet to whatever as well. What I want to do is remove the delay parameter from bullets completely. This will mean that when you spawn a bullet, it is immediately effective and immediately begins moving without a delay. To achieve the same result as the above code, you have to do this instead:
CreateStbDelay(GetX, GetY, YELLOW, 10);  //Delay effect lasting 10 frames.
Wait(10); //Wait 10 frames.
ObjStbShot_Initialize(GetX, GetY, 3, GetAngleToPlayer, YELLOW01, 30, 8, YELLOW); //Shot immediately when called.


The reason this will increase performance is because the current code loops through the whole StbShots array every frame to manage delay. If I can get rid of it, then the code would only need to loop through the array once whenever the game speed changes (i.e. when you zoom or take a picture).

EDIT: The performance test results from implementing this on my computer...
Before: 400 bullets = ~50fps
After: 2100 bullets = ~56fps

No matter what anyone says, I'm keeping it like this.
« Last Edit: April 12, 2010, 06:22:32 AM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Garlyle

  • I can't brain today
  • I have the dumb
    • Tormod Plays Games
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #167 on: April 12, 2010, 06:54:19 AM »
Actually... I rather like that.  It also means we can play around with delay effects to pretty stuff up, too.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #168 on: April 12, 2010, 07:27:10 AM »
You know what, there's a bad thing about that and I have to rethink this. Delayed bullets should be able to be deleted even during delay so this isn't going to work...

As for playing with delay effects, you already could do that.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Nobu

  • Serendipitous Youkai
  • *
  • i post while naked
    • My Tumblr
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #169 on: April 12, 2010, 07:47:20 AM »
Apologies if this is old or anything, but have you seen this StB DMF clone yet Blargel?
Tumblr (sometimes NSFW) | PM for Facebook

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #170 on: April 12, 2010, 08:12:19 AM »
Apologies if this is old or anything, but have you seen this StB DMF clone yet Blargel?

I've seen a little and I think that whoever made that is pretty darn good. However, he (or they) is missing a few things like the pausing during picture taking, the leaf placeholder thingies on the side, and a good menu. In fact, he's using the white Aya character that I believe many other people have already. White Aya is an amazing piece of code (there's some stuff I haven't been able to figure out just by thinking about it and I'm too lazy to look through the code), but doesn't have everything in it.

In short, I'm aiming higher.
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #171 on: April 22, 2010, 05:53:09 PM »
Bumpity bump.

Hi have a really hard stage with controls that are hard to get used to. Now excuse me while I get back to StB engine making again after slacking off for two weeks.

EDIT: Fixed hitbox for the sun bullets.
« Last Edit: April 22, 2010, 07:23:25 PM by Blargel »
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #172 on: April 22, 2010, 09:39:28 PM »
....Aaaaand a video of said script.

Please don't drop this, it's fucking cool.

Azure Lazuline

  • Looooove!!
  • PM me for free huggles and love!
    • Entanma Project - indie game development
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #173 on: April 22, 2010, 09:56:41 PM »
Awesome script so far. Well, awesome concept at least (a lot of the details need a LOT of tweaking in the actual danmaku. I'd give more details, but I think the engine was the main point rather than the boss, so I'll let it slide). Great work, and thank you for finally making me not feel like the only person that likes Meltdown - though I didn't know there was an instrumental version!

Naut: I was actually planning to do something similar to this when I finish my other DMF project (which might be a while), so if Blargey doesn't go through with this, then you just have to wait a bit longer. (I'll probably do it in Musuu if that's out by then, though.)

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #174 on: April 22, 2010, 10:21:31 PM »
....Aaaaand a video of said script.

Please don't drop this, it's fucking cool.

It's on hold until StB engine is workable for a whole game. Because I like this idea better though, Ikareimu will likely be dropped... or put on a indefinitely long hold. I'm not even sure what I'm going to do with my ExSatori script I was doing before either...  ???

Awesome script so far. Well, awesome concept at least (a lot of the details need a LOT of tweaking in the actual danmaku. I'd give more details, but I think the engine was the main point rather than the boss, so I'll let it slide). Great work, and thank you for finally making me not feel like the only person that likes Meltdown - though I didn't know there was an instrumental version!
If you thought the danmaku needed tweaking, you should've seen what I had when I was just starting the stage design. I thought everything was relatively balanced for a Lunautic difficulty script when I released it since I was able to beat everything without dying, though not all in one run. Also, that's not just an instrumental version of Meltdown, it's a ZUNified version. :V
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #175 on: April 23, 2010, 02:47:08 AM »
Oh god that's freaking awesome... (flashbacks on my rpg crap also :V)

Well... it seems to me like the bullets reappear at the opposite side when they leave the screen, right?

also... I like you're idea for spawning enemies a lot more than mine... instead of just spawning them at certain points on the map, you spawned them in waves depending on the player's position... a lot easier in terms of coding positions... and it actually looks cooler...

I suck :ohdear:

EDIT: This made me consider highly reconstructing my code... if it's alright with you, can I copy your way of spawning enemies? (ugh... I'll have to recreate the stage setup also.. at least I've only done a few things so far :V)
« Last Edit: April 23, 2010, 10:07:36 AM by Kylesky »
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Solais

  • Developer fairy
  • is working for a game developer now.
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #176 on: April 23, 2010, 10:13:42 AM »
....You never cease to amaze me, mon.

Blargel

  • RAWR!
  • I'M AN ANGRY LOLI!
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #177 on: April 23, 2010, 10:28:42 AM »
Oh god that's freaking awesome... (flashbacks on my rpg crap also :V)

Well... it seems to me like the bullets reappear at the opposite side when they leave the screen, right?

also... I like you're idea for spawning enemies a lot more than mine... instead of just spawning them at certain points on the map, you spawned them in waves depending on the player's position... a lot easier in terms of coding positions... and it actually looks cooler...

I suck :ohdear:

EDIT: This made me consider highly reconstructing my code... if it's alright with you, can I copy your way of spawning enemies? (ugh... I'll have to recreate the stage setup also.. at least I've only done a few things so far :V)
You don't suck, lol. But if you feel like it, take whatever little ideas you want. If you want code, look for it yourself, my thing is neatly organized like a labyrinth with no comments to be found anywhere. There's duplicate code too because of the way I organized normal enemies and bosses and because I rushed like hell when it was nearing completion. :V

....You never cease to amaze me, mon.
:3
<WorkingKeine> when i get home i just go to the ps3 and beat people up in blazblue with a loli
<Azure> Keine: Danmakufu helper by day, violent loli by night.

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #178 on: April 23, 2010, 10:52:12 AM »
You don't suck, lol. But if you feel like it, take whatever little ideas you want. If you want code, look for it yourself, my thing is neatly organized like a labyrinth with no comments to be found anywhere. There's duplicate code too because of the way I organized normal enemies and bosses and because I rushed like hell when it was nearing completion. :V

lol, thanks... and my code's are also usually labyrinths with no comments :V I can probably still understand your code (at least... by a little bit)

Now that I'm getting error after error in my parsee script (don't ask why :V), I feel like rage quitting on this script and remake her from scratch...
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry

Kylesky

  • *The Unknown*
  • Local Unbalanced Danmakufu Idiot Scripter
    • My useless youtube account... (will be useful in the future *I promise*)
Re: Blargel's Danmakufu Corner (StB/DS Engine)
« Reply #179 on: May 02, 2010, 12:42:25 AM »
Sorry for double post, but you probably wouldn't notice this if it didn't magically go back to the top :V

Ok, first I'm sorry for leaving that piece of crap on IRC last night, please disregard it... it was completely wrong and messed up, but I thought of the solution to the Collision problem already... It's pretty long and my current computer time is extremely limited so I may not be able to type everything down, and I'm not sure when I'll get back on... I don't care if you solved it already :V I just wanna post this somewhere...

This is unprecedented non-serious affair. Guy is preparing. Please wait warmly.

EDIT: God that a a fucking lot... I might've missed something though :V

Code: [Select]
//I probably could've shortened this a lot and removed some parts, but it's easier to understand like this

function Collision_Line_Line(x1, y1, x2, y2, x3, y3, x4, y4) //Gets whether 2 widthless segments intersect, actually there's an easier way, but this is easier to understand
{
    let lineangle=atan2(y4-y3, x4-x3);
    let slope=(y2-y1)/(x2-x1);
    if(x2-x1==0){slope=NULL;} //to prevent x/0
    let slopeb=(y4-y3)/(x4-x3);
    if(x4-x3==0){slopeb=NULL;} //to prevent x/0
    if(slopeb==NULL){ //if lineb is vertical
        if( (x1<=x3 && x2>=x3)||(x1>=x3 && x2<=x3) ){return true;}else{return false;} //if linea's 2 points lie on opposite sides of lineb, true, else, false
    }else if(slopeb==0){ //if lineb is horizontal
        if( (y1<=y3 && y2>=y3)||(y1>=y3 && y2<=y3) ){return true;}else{return false;} //if linea's 2 points lie on opposite sides of lineb, true, else, false
    }else{
    let x5=x1+absolute(x1-x3)*cos(lineangle); //fails at getting the x coordinate of the point where the y's are equal, but you get the idea
    let y5=y1+absolute(y1-y3)*sin(lineangle); //fails at getting the y coordinate of the point where the x's are equal, but you get the idea
    let x6=x2+absolute(x2-x3)*cos(lineangle); //fails at getting the x coordinate of the point where the y's are equal, but you get the idea
    let y6=y2+absolute(y2-y3)*sin(lineangle); //fails at getting the y coordinate of the point where the x's are equal, but you get the idea
        if(slopeb>0){ //if lineb y decreases as x increases
            if(slope==NULL){
            if( (x1<=x5 && x2>=x6)|| (x1>=x5 && x2<=x6) ){return true;}else{return false;} //opposite sides again
            }else{
                if( x1<x5 && y1<y5 ){ //if point1 is to the left-up of lineb
                    if( x2>x6 && y2>y6 ){return true;}else{return false;} //if point2 is to the right-down of line b, true, else, false
                }else if( x1>x5 && y1>y5 ){ //opposite of previous statement (for angle+180 instances)
                    if( x2<x6 && y2<y6 ){return true;}else{return false;}
                }else if( (x1==x5 && y1==y5) || (x2==x6 && y2==y6) ){return true;}else{return false;} //if point1/2 is collinear with lineb true, else, false
            }
        }
        if(slopeb<0){ //opposite of the entire slopeb>0 if statement
            if(slope==NULL){
            if( (x1<=x5 && x2>=x6)|| (x1>=x5 && x2<=x6) ){return true;}else{return false;} //opposite sides again
            }else{
                if( x1>x5 && y1<y5 ){ //if point1 is to the left-up of lineb
                    if( x2<x6 && y2>y6 ){return true;}else{return false;} //if point2 is to the right-down of line b, true, else, false
                }else if( x1<x5 && y1>y5 ){ //opposite of previous statement (for angle+180 instances)
                    if( x2>x6 && y2<y6 ){return true;}else{return false;}
                }else if( (x1==x5 && y1==y5) || (x2==x6 && y2==y6) ){return true;}else{return false;} //if point1/2 is collinear with lineb true, else, false
            }
        }
    }
} //actually... this is already the line to line function you're looking for :V I just want to continue

function Collision_Box_Line(centx, centy, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6) //Gets whether any segment from the center of the box to any corner intersects the line. (if at least one does then the box intersects the line obviously) Admittedly, this could be faster done by just checking the opposite corners, but this method is easier to understand
{ //you need to center cause I'm too lazy to calculate for it :V
    let returnval=0; //it's easier than an if statement with 3 ||'s right?
    if(Collision_Line_Line(centx, centy, x1, y1, x5, y5, x6, y6)==true){returnval++;}
    if(Collision_Line_Line(centx, centy, x2, y2, x5, y5, x6, y6)==true){returnval++;}
    if(Collision_Line_Line(centx, centy, x3, y3, x5, y5, x6, y6)==true){returnval++;}
    if(Collision_Line_Line(centx, centy, x4, y4, x5, y5, x6, y6)==true){returnval++;}
    if(returnval>=1){return true;}else{return false;}
} //notice that this statement can easily be used for a polygon with any number of sides by changing the number of parameters

function PointSideFromLine(x1, y1, x2, y2, x3, y3) //Gets whether a point is on the left or the right of a line
{
    let lineangle=atan2(y3-y2, x3-x2);
    let x4=x1+absolute(x1-x2)*cos(lineangle); //fails at getting the x coordinate of the point where the y's are equal, but you get the idea
    let y4=y1+absolute(y1-y2)*sin(lineangle); //fails at getting the y coordinate of the point where the x's are equal, but you get the idea
    if(x1<=x4){return "LEFT";}else{return "RIGHT";}
} //note that I could've just called this multiple times for the first statement, but it's easier to understand like that (at least, for me it is)

function Collision_Box_Laser(centx, centy, x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, width) //god... 15 parameters
{
    if(PointSideFromLine(centx, centy, x5, y5, x6, y6)=="LEFT"){
        if(Collision_Box_Line(centx, centy, x1, y1, x2, y2, x3, y3, x4, y4, x5-width/2, y5-width/2, x6-width/2, y6-width/2)==true){return true;}else{return false;}
        //uses the leftmost line of the laser
    }else{
        if(Collision_Box_Line(centx, centy, x1, y1, x2, y2, x3, y3, x4, y4, x5+width/2, y5+width/2, x6+width/2, y6+width/2)==true){return true;}else{return false;}
        //uses the rightmost line of the laser
    }
}

Collision_Box_Laser... the computation for the x's and y's may be a bit off, but you can use your super math to get those :V, but you get the idea I'm trying to show right?

and now I have to leave until god knows when...
« Last Edit: May 02, 2010, 01:35:35 AM by Kylesky »
Danmakufu Script Thread :V Latest Script: Intertwining Mechanical Intervention (temp name)

Yooooouuutuuuubeeee Channel Latest Video: Contest #8 Entry