Overv, I tried to join through Jaanus and it wouldn't let me use his account in chat, what's up with that?
[QUOTE=Overv;31369199]Anyone interested in beta testing my chatbox?
[url]http://www.overvprojects.nl/fpchat/[/url][/QUOTE]
All it needs is sub chat rooms for the different forums.
Current project? Desktop client for Chat that communicated with websockets (not the FP chat or overv's) Used reflection and System.Web.Script.Serialisation.JavaScriptSerialiser so could have nice and simple packet classes like
[cpp]
/// <summary>
/// Admin broadcast.
/// <Permission>This command is admin only.</Permission>
/// </summary>
public class BRO:BaseMessage
{
/// <summary>
/// Message broadcast
/// </summary>
public string message { get; set; }
}
[/cpp]
[cpp]
class MethodContainer {
public:
functor<void, MethodContainer&> Method;
};
int main(){
MethodContainer TestObject;
TestObject.Method = [](MethodContainer& self){
std::cout << "Not really." << std::endl;
};
TestObject.Method += [](MethodContainer& self){
std::cout << "ERROR" << std::endl;
return false;
};
TestObject.Method(TestObject);
return 0;
}[/cpp]
[code]ERROR
Not really.[/code]
Overloaded () and = operators.
Now, is that a good way to do it? Passing the object to the method everytime seems a bit herpy-derpy :v:
Now I could make a new class with an object member, but isn't there a better way to do it?
I'd like to initialize the functions directly at their declaration in the class (will apparently be possible with the new C++0x standard, but GCC doesn't support that at the moment, and it would still leave it not being bound to an object).
Now it seems the best way to initialize them is inside the constructor, but is there really no better way?
Now before anybody asks what the hell this would be useful for, think about a GUI library :dance:
Started working on a solar system simulator thing for school. Got the Earth orbiting the Sun.
[QUOTE][IMG]http://i.imgur.com/WWCkn.jpg[/IMG][/QUOTE]
The only problem is the orbit is circular and not elliptical. Any idea why?
[QUOTE=X-Neon;31371815]Started working on a solar system simulator thing for school. Got the Earth orbiting the Sun.
The only problem is the orbit is circular and not elliptical. Any idea why?[/QUOTE]
You must be using sin/cos huh
[QUOTE=Map in a box;31371897][/QUOTE]
Amazingly insightful.
[QUOTE=NorthernGate;31372049]Amazingly insightful.[/QUOTE]
I fixed it kay? :frown:
[QUOTE=X-Neon;31371815]Started working on a solar system simulator thing for school. Got the Earth orbiting the Sun.
The only problem is the orbit is circular and not elliptical. Any idea why?[/QUOTE]
It will only be a circle if you set the Earth moving with exactly the right velocity. Try starting the Earth with less speed, or check that your gravity acts with the inverse square law.
[QUOTE=X-Neon;31371815]Started working on a solar system simulator thing for school. Got the Earth orbiting the Sun.
The only problem is the orbit is circular and not elliptical. Any idea why?[/QUOTE]
Change line 28 to use cos(ang) instead of sin(ang) and fiddle with the consts at the top a bit, that should fix it!
[QUOTE=WeltEnSTurm;31371484][cpp]class test {
public:
functor<void, test&> derp;
};
int main(){
test blblbl;
blblbl.derp = [](test& self){
std::cout << "Not really." << std::endl;
};
blblbl.derp += [](test& self){
std::cout << "ERROR" << std::endl;
return false;
};
blblbl.derp(blblbl);
return 0;
}[/cpp]
[code]ERROR
Not really.[/code]
Overloaded () and = operators.
Now, is that a good way to do it? Passing the object to the method everytime seems a bit herpy-derpy :v:
Now I could make a new class with an object member, but isn't there a better way to do it?
I'd like to initialize the functions directly at their declaration in the class (will apparently be possible with the new C++0x standard, but GCC doesn't support that at the moment, and it would still leave it not being bound to an object).
Now it seems the best way to initialize them is inside the constructor, but is there really no better way?
Now before anybody asks what the hell this would be useful for, think about a GUI library :dance:[/QUOTE]
Event callbacks? Event callbacks!
[QUOTE=Ziks;31372128]It will only be a circle if you set the Earth moving with exactly the right velocity. Try starting the Earth with less speed, or check that your gravity acts with the inverse square law.[/QUOTE]
Now it works. I thought that if you set it to the "perfect" speed, it would naturally form an ellipse.
[cpp]
public class BaseMessage
{
[ScriptIgnore]
public string Name
{
get
{
return this.GetType().Name;
}
}
public string Serialize()
{
JavaScriptSerializer ser = new JavaScriptSerializer();
string s = Name+" " + ser.Serialize(this);
return s;
}
public static BaseMessage Deserialise(string message)
{
BaseMessage mess;
string type = message.Substring(0, 3);
Type t = Type.GetType("Chat.Message." + type);
JavaScriptSerializer ser = new JavaScriptSerializer();
if (message.Length == 3)
{
ConstructorInfo[] ci = t.GetConstructors();
mess = (BaseMessage)ci[0].Invoke(null);
return mess;
}
mess = (BaseMessage)ser.Deserialize(message.Substring(4), t);
return mess;
}
}
[/cpp]
Base class of all my messages, this is what converts the class to a string to be sent by websocket, and can convert the string recieved back into the appropriate class
[QUOTE=X-Neon;31373270]Now it works. I thought that if you set it to the "perfect" speed, it would naturally form an ellipse.[/QUOTE]
Yes, because a circle is a special ellipse.
[QUOTE=Robber;31373369]Yes, because a circle is a special ellipse.[/QUOTE]
What are you talking about? Earth's orbit is very slightly elliptical: it's why we get seasons...
[B]Edit:[/B]
That said, it would look like a circle to within 1 pixel at that sort of zoom I expect.
[QUOTE=TheBoff;31373525]What are you talking about? Earth's orbit is very slightly elliptical: it's why we get seasons...[/QUOTE]
That's not the reason for our seasons, it can't be because then the season would be the same everywhere on the earth, which it isn't.
[QUOTE=TheBoff;31373525]What are you talking about? Earth's orbit is very slightly elliptical: it's why we get seasons...[/QUOTE]
What have you been reading
The axial tilt of the earth causes seasons
[QUOTE=Richy19;31369909]Can you give some more info on this? I tried something similar a couple of months ago but couldn manage to do so[/QUOTE]
Maybe this helps?
[img]http://i.imgur.com/leoIw.gif[/img]
colors of the dots:
green = road split
red = collision with other road so it cuts it off
orange and purple are not working properly right now (supposed to remove those ugly parts with multiple roads very close to eachother)
Anyone know some good resources for making platformers?
The physics for controlling the player, specifically? (I'm using box2d)
[QUOTE=ZenX2;31373756]What have you been reading
The axial tilt of the earth causes seasons[/QUOTE]
Actually, you and him are only 50% correct each, the combination of the Earth's orbit and the Axial Tilt cause Seasons, not just one or the other.
[quote=http://www.universetoday.com/61202/earths-orbit-around-the-sun/]The seasons are caused by a combination of two factor: the Earth’s axial tilt and its distance from the Sun during the orbital period. The planet is tilted 23.4° offset of the axis from a direction perpendicular to the Earth’s orbital plane. This puts a different hemisphere towards the Sun at different times of the year. When the Earth is at a certain place in its orbit, the northern hemisphere is tilted toward the Sun and experiences summer. Six months later, when the Earth is on the opposite side of the Sun, the northern hemisphere is tilted away from the Sun and experiences winter.
The shape of Earth’s orbit isn’t quite a perfect circle. It is more like a “stretched out” circle or an oval. Mathematicians and astronomers call this shape an “ellipse”. An ellipse can be long and skinny or it can be very round. Scientists need a way to describe how round or “stretched out” an ellipse is. They use a number to describe this, and call it the eccentricity of the ellipse. Eccentricity is always between zero and one for an ellipse. If it is close to zero, the ellipse is nearly a circle. If it is close to one, the ellipse is long and skinny. Earth’s orbit is almost a circle, it has an eccentricity of less than 0.02. That is why the distance from the Sun at perihelion and aphelion are very close.[/quote]
But heh, this isn't an astronomy thread.
[QUOTE=ZenX2;31373781]Anyone know some good resources for making platformers?
The physics for controlling the player, specifically? (I'm using box2d)[/QUOTE]
Why are you using a ten-ton hammer to nail in some nails?
Use this instead:
[url]http://www.metanetsoftware.com/technique/tutorialA.html[/url]
Could anyone who wasn't able to register earlier try again?
[url]http://www.overvprojects.nl/fpchat/[/url]
You don't have to chat, I just need to know if registering works better now.
[QUOTE=ZomBuster;31373770]Maybe this helps?
[img]http://i.imgur.com/leoIw.gif[/img]
colors of the dots:
green = road split
red = collision with other road so it cuts it off
orange and purple are not working properly right now (supposed to remove those ugly parts with multiple roads very close to eachother)[/QUOTE]
Did you use any tutorials or resources or algorithms?
Wohoo, procedural puzzle generation for my game. Worked out an algorithm on paper and set to work :v:
Worked first time... This is nice.
[editline]28th July 2011[/editline]
[QUOTE=ZenX2;31373756]What have you been reading
The axial tilt of the earth causes seasons[/QUOTE]
Naa, that's when the sun moves round the earth. Further away makes it colder but also makes the days last longer. You just didn't notice because science lied to you.
[QUOTE=Loli;31376403]Worked first time... This is nice.[/QUOTE]
Best feeling in the world... especially after you've been coding for hours without once compiling.
[QUOTE=ZomBuster;31373770]Maybe this helps?
[img]http://i.imgur.com/leoIw.gif[/img][/QUOTE]
This would make for a kickass screensaver.
[QUOTE=q3k;31376736]This would make for a kickass screensaver.[/QUOTE]
Especially if it scrolled from left to right, infinitely generating an infinitely complicated city. With a traffic system with 1 way roads etc, and police chases and pedestrians and muggings and... Damn it, that would actually make for a pretty fun game.
[QUOTE=Loli;31376795]Especially if it scrolled from left to right, infinitely generating an infinitely complicated city. [b]With a traffic system with 1 way roads etc, and police chases and pedestrians and muggings and... Damn it, that would actually make for a pretty fun game.[/b][/QUOTE]
Way to take it out of proportion :v:
Here, have a video on what's in Space Hazard so far...
[media]http://www.youtube.com/watch?v=qy_Zm14lRMw[/media]
New stuff since I last posted about it:
- Red screen flashing when damaged
- Updated dungeon generation
- Background generator now generates stuff that's not only blue/cyan, and it also generates textures that seamlessy scroll (it draws the same texture 5 times with different offsets, scales and parallax, so it looks really cool)
- New enemy: Fighter!
(also don't ask about the music, the video was so silent so I slapped a random song on it which I had in my songs folder)
(also cannons disabled for demonstration purposes)
Sorry, you need to Log In to post a reply to this thread.