Bitcoin Forum

Other => Off-topic => Topic started by: Remember remember the 5th of November on August 28, 2013, 01:26:39 AM



Title: The Internet has been very stale lately.
Post by: Remember remember the 5th of November on August 28, 2013, 01:26:39 AM
I mean, since Antoine Dodson's Bed Intruder song, UCLA Alexandra Wallace and Harlem Shake, there has been for a long while...nothing trollish,racist,meme-like...


Title: Re: The Internet has been very stale lately.
Post by: MysteryMiner on August 28, 2013, 01:59:18 AM
https://encyclopediadramatica.se/Main_Page


Title: Re: The Internet has been very stale lately.
Post by: Kyle91 on August 28, 2013, 03:41:41 AM
go on 4chan


Title: Re: The Internet has been very stale lately.
Post by: PerfectAgent on August 28, 2013, 05:10:50 AM
https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-ash4/p480x480/1002293_484495644978156_8824568_n.png


Title: Re: The Internet has been very stale lately.
Post by: Lethn on August 28, 2013, 05:57:34 AM
It's true actually :( the internet isn't being as original as it used to be, maybe everyones working on news stuff or something, i need to hurry up and finish learning the coding I need so I can make some fun games to play and not be bored anymore lololool :D


Title: Re: The Internet has been very stale lately.
Post by: b!z on August 28, 2013, 10:01:09 AM
Yes! But this for lolz


https://encyclopediadramatica.se/Brute_Forcing

the leethecking guides on ED are all from 2003 or something, they're hilarious to read


Title: Re: The Internet has been very stale lately.
Post by: Remember remember the 5th of November on August 28, 2013, 11:34:21 AM
It's true actually :( the internet isn't being as original as it used to be, maybe everyones working on news stuff or something, i need to hurry up and finish learning the coding I need so I can make some fun games to play and not be bored anymore lololool :D
Already ahead of you :D

https://i.imgur.com/Iqcv1a3.png


Title: Re: The Internet has been very stale lately.
Post by: Lethn on August 28, 2013, 12:31:19 PM
Hah! Bet you're not fixing the FPS issues yet :P


Title: Re: The Internet has been very stale lately.
Post by: b!z on August 28, 2013, 01:24:42 PM
It's true actually :( the internet isn't being as original as it used to be, maybe everyones working on news stuff or something, i need to hurry up and finish learning the coding I need so I can make some fun games to play and not be bored anymore lololool :D
Already ahead of you :D

https://i.imgur.com/Iqcv1a3.png

Looks like space invaders + mario


Title: Re: The Internet has been very stale lately.
Post by: Lethn on August 28, 2013, 02:05:13 PM
I know we just hijacked this thread but what the hell :P maybe we should make a thread just to show off our WIP games :D, so far I've managed to make my rabbit thingy move across the screen, need to fix FPS and add collision in for it to properly work and of course put in some gravity.

http://i1134.photobucket.com/albums/m602/Lethn/SFML%20Built%20Games/TheRabbitandtheMoon_zps1fd439e2.png (http://s1134.photobucket.com/user/Lethn/media/SFML%20Built%20Games/TheRabbitandtheMoon_zps1fd439e2.png.html)

The idea is it's a basic platformer and you play as a rabbit that has to jump up clouds to the moon, the stars are either powerups or bad guys depending on their emotions :P


Title: Re: The Internet has been very stale lately.
Post by: C10H15N on August 28, 2013, 02:13:57 PM
The Internet is so 90's...   


Title: Re: The Internet has been very stale lately.
Post by: Remember remember the 5th of November on August 28, 2013, 02:31:20 PM
Collision is simple, assuming that your characters are rectangles here is a sample of my old code

Code:
bool check_collision_rect(Rect *A, Rect *B)
{
    //The sides of the rectangles
    int leftA, leftB;
    int rightA, rightB;
    int topA, topB;
    int bottomA, bottomB;


    //Calculate the sides of rect A
    leftA = A->x;
    rightA = A->x + A->w;
    topA = A->y;
    bottomA = A->y + A->h;

    //Calculate the sides of rect B
    leftB = B->x;
    rightB = B->x + B->w;
    topB = B->y;
    bottomB = B->y + B->h;

    //If any of the sides from A are outside of B
    if(bottomA <= topB)
    {
        return false;
    }

    if(topA >= bottomB)
    {
        return false;
    }

    if(rightA <= leftB)
    {
        return false;
    }

    if(leftA >= rightB)
    {
        return false;
    }

    //If none of the sides from A are outside B
    return true;
}

and

Code:
double distance(int x1, int y1, int x2, int y2)
{
    //Return the distance between the two points
    return sqrt( pow( x2 - x1, 2 ) + pow( y2 - y1, 2 ) );
}

bool collision_circle(Circle A, Circle B)
{
    //If the distance between the centers of the circles is less than the sum of their radii
    if(distance(A.x, A.y, B.x, B.y) < (A.r + B.r))
    {
        //The circles have collided
        return true;
    }
    
    //If not
    return false;
}

It's true actually :( the internet isn't being as original as it used to be, maybe everyones working on news stuff or something, i need to hurry up and finish learning the coding I need so I can make some fun games to play and not be bored anymore lololool :D
Already ahead of you :D

Looks like space invaders + mario
Yeah, I was inspired by mario. At first I was going to make so you could walk up,down,left,right but then decided to make it like Super Mario from 84 for SNES.


Title: Re: The Internet has been very stale lately.
Post by: Lethn on August 28, 2013, 02:49:29 PM
I'm using SFML myself so the code is already there, I just need to implement it all into my game properly which is harder than it looks!


Title: Re: The Internet has been very stale lately.
Post by: FirstAscent on August 28, 2013, 03:28:10 PM
Code:
bool check_collision_rect(Rect *A, Rect *B)
{
    // The sides of the rectangles
    int leftA, leftB;
    int rightA, rightB;
    int topA, topB;
    int bottomA, bottomB;

    // Calculate the sides of rect A
    leftA   = A->x;
    rightA  = A->x + A->w;
    topA    = A->y;
    bottomA = A->y + A->h;

    // Calculate the sides of rect B
    leftB   = B->x;
    rightB  = B->x + B->w;
    topB    = B->y;
    bottomB = B->y + B->h;

    // If any of the sides from A are outside of B
    if(bottomA <= topB) {
        return false;
    }

    if(topA >= bottomB) {
        return false;
    }

    if(rightA <= leftB) {
        return false;
    }

    if(leftA >= rightB) {
        return false;
    }

    // If none of the sides from A are outside B
    return true;
}

and

Code:
double distance(int x1, int y1, int x2, int y2)
{
    // Return the distance between the two points
    return sqrt(pow(x2 - x1, 2) + pow( y2 - y1, 2));
}

bool collision_circle(Circle A, Circle B)
{
    // If the distance between the centers of the circles is
    // less than the sum of their radii
    if(distance(A.x, A.y, B.x, B.y) < (A.r + B.r)) {
        //The circles have collided
        return true;
    }
    
    // If not
    return false;
}

Fixed your code. Issues included no spaces between comments and double slashes, failure to put opening curly bracket for if/else/for/while constructs on same line as opening statement, failure to align assignment operator for variables belonging to a group, and excess spacing around parenthesis.


Title: Re: The Internet has been very stale lately.
Post by: Lethn on August 28, 2013, 03:30:04 PM
He did say it was old code you know :P


Title: Re: The Internet has been very stale lately.
Post by: RodeoX on August 28, 2013, 03:33:10 PM
Old school!

http://www.cswnet.com/~ozarksof/ani/babydanc.gif


Title: Re: The Internet has been very stale lately.
Post by: FirstAscent on August 28, 2013, 04:50:54 PM
Old school!

What is old school?


Title: Re: The Internet has been very stale lately.
Post by: Lauda on August 28, 2013, 04:57:27 PM
9gag and 4chan.


Title: Re: The Internet has been very stale lately.
Post by: RodeoX on August 28, 2013, 06:00:17 PM
Why the dancing baby of course. Hello 1996.

http://en.wikipedia.org/wiki/Dancing_baby


Title: Re: The Internet has been very stale lately.
Post by: Remember remember the 5th of November on August 28, 2013, 07:05:12 PM
Code:
bool check_collision_rect(Rect *A, Rect *B)
{
    // The sides of the rectangles
    int leftA, leftB;
    int rightA, rightB;
    int topA, topB;
    int bottomA, bottomB;

    // Calculate the sides of rect A
    leftA   = A->x;
    rightA  = A->x + A->w;
    topA    = A->y;
    bottomA = A->y + A->h;

    // Calculate the sides of rect B
    leftB   = B->x;
    rightB  = B->x + B->w;
    topB    = B->y;
    bottomB = B->y + B->h;

    // If any of the sides from A are outside of B
    if(bottomA <= topB) {
        return false;
    }

    if(topA >= bottomB) {
        return false;
    }

    if(rightA <= leftB) {
        return false;
    }

    if(leftA >= rightB) {
        return false;
    }

    // If none of the sides from A are outside B
    return true;
}

and

Code:
double distance(int x1, int y1, int x2, int y2)
{
    // Return the distance between the two points
    return sqrt(pow(x2 - x1, 2) + pow( y2 - y1, 2));
}

bool collision_circle(Circle A, Circle B)
{
    // If the distance between the centers of the circles is
    // less than the sum of their radii
    if(distance(A.x, A.y, B.x, B.y) < (A.r + B.r)) {
        //The circles have collided
        return true;
    }
    
    // If not
    return false;
}

Fixed your code. Issues included no spaces between comments and double slashes, failure to put opening curly bracket for if/else/for/while constructs on same line as opening statement, failure to align assignment operator for variables belonging to a group, and excess spacing around parenthesis.
Those are just semantics, I write clean code, if you see how the MyBB team code it's just gorgeous.

Plus

if(eval)
{
    // code
}

is much better than

if(eval) {
    // code
}


Title: Re: The Internet has been very stale lately.
Post by: FirstAscent on August 28, 2013, 07:45:18 PM
Quote from: Remember remember the 5th of November
Those are just semantics, I write clean code, if you see how the MyBB team code it's just gorgeous.
[/quote

No, I haven't seen. Are you claiming your code is gorgeous?

Quote
Plus

if(eval)
{
    // code
}

is much better than

if(eval) {
    // code
}

It's much better? One of the reasons for putting the opening curly on the same line is to show a little more code per page, decreasing scrolling for comprehension. Note that I'm not using the word 'better'. I'm stating a reason for a preference.

Whitespace is good, and necessary, but not in this case.


Title: Re: The Internet has been very stale lately.
Post by: Lauda on August 28, 2013, 07:59:09 PM
Stop with this useless code.


Title: Re: The Internet has been very stale lately.
Post by: miffman on August 28, 2013, 09:28:53 PM
If you think the Internet is stale, you haven't been to leekspin.com recently  ;D


Title: Re: The Internet has been very stale lately.
Post by: Lauda on August 28, 2013, 09:42:14 PM
If you think the Internet is stale, you haven't been to leekspin.com recently  ;D
Ty! I forgot about this site i find it funny, time to bookmark and hypnotise myself!  :D
http://leekspin.com/
For link purposes.


Title: Re: The Internet has been very stale lately.
Post by: MysteryMiner on August 28, 2013, 11:41:32 PM
Now that's a real smoothie! New avatar anyone?
 https://images.encyclopediadramatica.se/2/26/Lolmouse.gif


Title: Re: The Internet has been very stale lately.
Post by: Foxpup on August 29, 2013, 01:14:50 AM
Collision is simple, assuming that your characters are rectangles here is a sample of my old code
Collision detection is simple (for simple shapes, anyway); it's collision response that's the hard part. ;)

For platform games, this depends on the type of objects that collided.

The simplest case is, of course, a bullet. A colliding bullet simply disappears and causes damage to whatever it collided with.

Enemy vs. player collisions are more complicated, since unless the player is a one hit-point wonder, both objects will still be around and still be intersecting unless you do something about it. Depending on the game, you may or may not want enemies to be solid (see below), and in either case, if the collision itself causes damage (as opposed to the more realistic case of requiring one actor to actually perform an attack in order to damage the other), then you need knockback and/or mercy invincibility to avoid repeating the damage on every frame.

Finally comes the platforms themselves (as well as anything else that functions as a solid platform). Here, it's important to know which direction the collision came from (whether you walked into a wall, bumped your head on the ceiling, or are standing on the floor). For square actors, this can be accomplished by checking which axis (X or Y) has the greatest absolute difference between the distance and the sum of the sizes of the actors (ie, how deeply they're interpenetrating) (for rectangular actors, you also need to take into account the actors' aspect ratio). The sign of the difference tells you the direction. Then it's just a simple matter for zeroing the moving actor's velocity in that axis, and clipping its position to the plane of the platform. For the special case of collisions from above (standing on the floor), you also want to set a flag saying that the actor is standing on a floor, so you can set appropriate animation, etc.

Note that all of the above only applies if no object can move fast enough to reach the other side of another within a single frame (mostly a problem for bullets, but can affect falling players if they have no terminal velocity). In that case, it gets even more complicated.


Title: Re: The Internet has been very stale lately.
Post by: Phinnaeus Gage on August 29, 2013, 06:42:49 AM
Wait till the song B.DOUBLE O.T.Y comes out in both a rap and country version at the same time.