Page 2 of 2

Re: How do YOU make a game? [Team Thread]

PostPosted: Sat Mar 10, 2012 4:37 pm
by SuperSonic
Hblade wrote:Good idea! XD
Thanks ^^. Oh, I also improved it this morning. Here's the new one:
Code: Select all
void viewfollow(int sensitivity, int xoffset, int yoffset)
{
    view.x += ((x + xoffset) - (view.x + view.width/2 ))/sensitivity;
    view.y += ((y + yoffset) - (view.y + view.height/2))/sensitivity;
}
Now you can have an offset =D

Hblade wrote:And lol at the coolness being ruined.
xDDDD

Re: How do YOU make a game? [Team Thread]

PostPosted: Sat Mar 10, 2012 4:49 pm
by Hblade
How about this:
Code: Select all
    angle=direction(x+view.width/2,y+view.height/2,Follower.x,Follower.y);
    directional_velocity=distance(x+view.width/2,y+view.height/2,Follower.x,Follower.y)/10;


This will make it smooth, like in CaveStory, or some Action RPG's

Re: How do YOU make a game? [Team Thread]

PostPosted: Sat Mar 10, 2012 9:07 pm
by SuperSonic
Hblade wrote:This will make it smooth, like in CaveStory, or some Action RPG's
Ummm... I guess you didn't realize it, but I built my function so that it would be smooth xD. The bigger sensitivity is, the smoother the camera changes :wink:

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 12:28 am
by Hblade
Oh o-O! beast :D

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 5:34 am
by SuperSonic
Thanks ^^

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 6:05 am
by Hblade
np ^^

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 8:14 pm
by SuperSonic
I'll make some more as soon as I get some ideas :D

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 8:15 pm
by lcl
SuperSonic wrote:Thanks ^^

Hblade wrote:np ^^

A nice pair of topic-killers..
These kinds of one-word messages from one user to other are really powerful in stopping the conversation. xD I guess you know what I mean :wink:

Hey SuperSonic, I see that you tried to make the typing of functions name easier and that's good.
But in my opinion it is also important to pay attention to how readable it is.
What I use is this:

myFunction

So that the name begins with little letter and every new word begins with capital letter. This way you can easily see what words there are in the name, compare:

setgrav AND setGrav

:D it's easier to understand the code when the capital letters "jump" to your eyes.

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 9:14 pm
by SuperSonic
lcl wrote:A nice pair of topic-killers..
I am a topic murderer xD

lcl wrote:Hey SuperSonic, I see that you tried to make the typing of functions name easier and that's good.
But in my opinion it is also important to pay attention to how readable it is.
What I use is this:

myFunction

So that the name begins with little letter and every new word begins with capital letter. This way you can easily see what words there are in the name, compare:

setgrav AND setGrav

:D it's easier to understand the code when the capital letters "jump" to your eyes.
Yeah, I like to use caps sometimes, but when I do, I also cap the first letter. Like this: void MyFunction();
:D

Re: How do YOU make a game? [Team Thread]

PostPosted: Sun Mar 11, 2012 9:15 pm
by Hblade
Hey your right!

Re: How do YOU make a game? [Team Thread]

PostPosted: Thu Mar 15, 2012 6:38 pm
by SuperSonic
I made another function. This one is for parallax scrolling :D
Code: Select all
void ParallaxScroll(float intensity)
{
    x += (2 * (-intensity + .5)) * (view.x - view.xprevious);
    y += (2 * (-intensity + .5)) * (view.y - view.yprevious);
}
All you have to do is put this in your actor's draw code. For intensity, use a number from 0 to 1. 0 for being completely in the background and 1 for being completely in front (0.5 for being at a standard distance of course =D).

I hope this helps someone :wink:

@Hblade: Would you mind putting my functions in your first post? That way, you could have people upload functions and share them here. I dunno. It's just an idea ^^

Re: How do YOU make a game? [Team Thread]

PostPosted: Fri Mar 16, 2012 3:28 pm
by Hblade
Good idea ^^ But I'm a tad confused about what you mean, you mean just slam this into the first post of this topic? ^^ SURE :D

I love this code! I'm so gonna use it.

Re: How do YOU make a game? [Team Thread]

PostPosted: Fri Mar 16, 2012 10:46 pm
by SuperSonic
Hblade wrote:Good idea ^^ But I'm a tad confused about what you mean, you mean just slam this into the first post of this topic? ^^ SURE :D
Yeah haha. But you didn't get my ViewFollow() function :roll:

Hblade wrote:I love this code! I'm so gonna use it.
Awsome! I was hoping someone could find a use for it =D

Re: How do YOU make a game? [Team Thread]

PostPosted: Sat Mar 17, 2012 10:32 am
by Hblade
Oh xD Fixing :)