Aww, I hate it when game of lifes come back into fashion. I lost my USB stick while I was working on mine in university and the only version I have left is about 5 hours of programming behind :(
[QUOTE=Robber;27407869]It's perfectly readable :confused:
[IMG_thumb]http://img684.imageshack.us/img684/4206/ss20110114133116.jpg[/IMG_thumb]
I love how his solution is called "Everything" :v:[/QUOTE]
Maybe renaming it to 42 would be better :D
Here is my second game made in c++:
[img]http://www.no-named.dk/files/upload/chess0.png[/img]
[img]http://www.no-named.dk/files/upload/chess1.png[/img]
[img]http://www.no-named.dk/files/upload/chess2.png[/img]
[img]http://www.no-named.dk/files/upload/chess3.png[/img]
I'm proud.
[QUOTE=Jallen;27395100]snip[/QUOTE]
doing rand() % something is pretty much the worst thing you can do with that random number generator..
[QUOTE=Icedshot;27409475]doing rand() % something is pretty much the worst thing you can do with that random number generator..[/QUOTE]
It means that higher / lower numbers have an uneven chance of being produced, but it's a relatively negligible difference in probability if I remember correctly and there isn't any way it could cause the looping.
It's not the worse thing you can do by a long shot.
I don't know if 'hacking' TF2-style hitmarkers into cs:s counts as programming.. but here you go:
[hd]http://www.youtube.com/watch?v=dNToOgH7VlY[/hd]
[QUOTE=Jallen;27409749]It means that higher / lower numbers have an uneven chance of being produced, but it's a relatively negligible difference in probability if I remember correctly and there isn't any way it could cause the looping.
It's not the worse thing you can do by a long shot.[/QUOTE]
The two least significant bits (which you're extracting by taking %4) could repeat with a period significantly shorter than the rest of the function's. The RNG could be designed to appear random in base 10, having more obvious patterns when you reduce it to base 2 or a multiple of it.
[img]http://www.1337upload.net/files/New_Bitmap_Image.bmp[/img]
Jumping on the bandwagon here, made my own perlin image generator.
[QUOTE=ThePuska;27410027]The two least significant bits (which you're extracting by taking %4) could repeat with a period significantly shorter than the rest of the function's. The RNG could be designed to appear random in base 10, having more obvious patterns when you reduce it to base 2 or a multiple of it.[/QUOTE]
Im pretty sure thats one of the problems
The higher bits from the c rand function are also significantly more random than the lower bits.
[QUOTE=Richy19;27399830]Dont you hate it when zombies are all up in you house?
[media]http://www.youtube.com/watch?v=yVq2TBfsTzk[/media]
Any thoughts on having zombie health or life bar on top of them?
Also is anyone able to make a better torch image? like with light dissipating on the sides as well?
I tried for like an hour and failed miserably
heres the torch
[media]http://img411.imageshack.us/img411/5392/torchx.png[/media]
God damn you imageshack and your white background, image is there you just need to DL it to actually see it[/QUOTE]
Uhm, I know people have already told you this etc, but please fix the perspective on those sprites.
It really ruins it when the player and zombies are top down but the rest of the map is oblique.. Your player also rotates around his hands which is kind of strange..
Other than that, it looks really nice :)
The flamethrower has a good looking effect.
[QUOTE=Azur;27410866]Uhm, I know people have already told you this etc, but please fix the perspective on those sprites.
It really ruins it when the player and zombies are top down but the rest of the map is oblique.. [/quote]
Theres nothing i can do about this, unless anyone knows of a good set of TD tile sheets.
[quote]Your player also rotates around his hands which is kind of strange..[/quote]
Working on this :D
[quote]Other than that, it looks really nice :)
The flamethrower has a good looking effect.[/QUOTE]
Thanks :buddy:
[editline]14th January 2011[/editline]
[QUOTE=Metroid48;27403464]I remember this showing up in the help thread. Anyway, since the gun is along the center of the player you really just need to calculate the direction vector for your character.
Assuming that 0 rad is right, the x component will be cos ( theta ) and the y component will be sin ( theta ). Then just multiply these by the barrel length, round them, and add to the bullet position at creation![/QUOTE]
Was it this?
[code]
//possiotionOnMap.X = (int)(((myGuy.position.X )- ( ( ( 16 * Math.Cos( myGuy.rotation ) ) - (-1 * Math.Sin( myGuy.rotation) ) ) ) ) );
//possiotionOnMap.Y = (int)(((myGuy.position.Y )- ( ( ( 16 * Math.Sin( myGuy.rotation ) ) + (-1 * Math.Cos( myGuy.rotation) ) ) ) ) );[/code]
[editline]14th January 2011[/editline]
For all of you bitching about it, the player now turns from his center
ie his head
Now if anyone knows of a nice tile set i could use i will recreate the maps
Yeah that'll rotate it all right, but it's pointlessly complicated. That's (almost) the general formula for rotating a vector.
[code]x' = x * cos(t) - y * sin(t)
y' = x * sin(t) + y * cos(t)[/code]
But with a smarter choice of x and y, you can simplify it. If you pick y=0, it simplifies the formula to
[code]
x' = x * cos(t)
y' = x * sin(t)
[/code]
that's
[code]gun.pos.x = guy.pos.x + gun.length*cos(guy.rot)
gun.pos.y = guy.pos.y + gun.length*sin(guy.rot)[/code]
[editline]14th January 2011[/editline]
Does anyone know if there's an efficient way to calculate both the sine and cosine of an angle in C# or do I need to come up with one myself?
[QUOTE=ThePuska;27411595]Yeah that'll rotate it all right, but it's pointlessly complicated. That's (almost) the general formula for rotating a vector.
[editline]14th January 2011[/editline]
Does anyone know if there's an efficient way to calculate both the sine and cosine of an angle in C# or do I need to come up with one myself?[/QUOTE]
Well, sin(x) = sqrt(1 - cos^2(x)), but with all the square roots and stuff, I'm not sure it's faster. I'm not sure there is a particularly efficient way to calculate them both. Have you tried google?
I guess you could have a table of values, and use the fact that sin and cos are just translations, but you either need a massive table, or limited accuracy.
There's FSINCOS which is extremely fast (almost as fast as FSIN on its own), but I don't think it's implemented in C#.
From my experiences with Delphi, evaluating their series definitions up to some fourth term was faster than FSINCOS and accurate for vector rotation in games for angles between -pi and pi.
Since their series definitions share so much, calculating the other almost automatically gives you the other.
Currently trying to write a report for a 3D environment (well a game without any gameplay) I wrote before Christmas, wish I had commented my code more. Nightmare trying to remember how I did half of it.
Layla, why is it that without fail you rate anything that's 3D (and not yours) dumb?
[QUOTE=ThePuska;27411595]Does anyone know if there's an efficient way to calculate both the sine and cosine of an angle in C# or do I need to come up with one myself?[/QUOTE]
Runtime-calculated oldskool trig tables? You probably don't need a huge accuracy for a game, and you can just generate sin from pi to pi/4 and get sin and cos out of that. For 0.01 degree accuracy (close enough for most uses, I presume) you just need 36kb of memory.
[QUOTE=TheBoff;27411848]Well, sin(x) = sqrt(1 - cos^2(x))[/QUOTE]
Well, cos is just sin moved by pi, so sin(x) = cos(x - pi).
I have no idea why you'd want to use that identity there.
[QUOTE=NovembrDobby;27412401]Layla, why is it that without fail you rate anything that's 3D (and not yours) dumb?[/QUOTE]
He's probably soda in disguise
We've been through this before
Guys, any good articles on perlin noise?
[url]http://freespace.virgin.net/hugo.elias/models/m_perlin.htm[/url]
[editline]14th January 2011[/editline]
it's the perlin-noise-bible
[QUOTE=Jallen;27413351]Guys, any good articles on perlin noise?[/QUOTE]
[url]http://freespace.virgin.net/hugo.elias/models/m_perlin.htm[/url]
First thing on google :v:
Edit:
Ninjas. Goddammit.
Edit2:
Had a look through the faster perlin noise method i was writing
Noticed there was some fairly massive accessing beyond an array's bounds
Program proceeded to no longer work
[QUOTE=Icedshot;27413381][url]http://freespace.virgin.net/hugo.elias/models/m_perlin.htm[/url]
First thing on google :v:
Edit:
Ninjas. Goddammit.[/QUOTE]
:ninja:
[QUOTE=q3k;27413179]Well, cos is just sin moved by pi, so sin(x) = cos(x - pi).
I have no idea why you'd want to use that identity there.[/QUOTE]
Because it allows you to calculate the value for sin based on the value for cos?
[editline]14th January 2011[/editline]
[QUOTE=ThePuska;27412007]Since their series definitions share so much, calculating the other almost automatically gives you the other.[/QUOTE]
Afaik they're completely different? Cos uses the odd terms of the Taylor expansion; Sin the even terms. I mean, at the moment, does it even matter? Have you got to the point where trig functions are a significant performance drain and you need the extra fps?
Holy Shit! A windows form in another thread and working sfml too!
[img]http://img255.imageshack.us/img255/6839/plugengine.png[/img]
Now i need to find way to add Entrypoints to a C# dll... anyone have an idea?
also i need to set the icon to the sfml window...
[QUOTE=TheBoff;27413762]Because it allows you to calculate the value for sin based on the value for cos?[/QUOTE]
Yes, but since you're getting the value of the function for a specific argument (if not then you may be Doing It Wrong), you might as well take advantage that. It's not like a cos value magically appear in your code and your quest is to find the sin value for it. :v:
Why can't I make anything as awesome as on this thread? :'[
[QUOTE=Kamrua;27414830]Why can't I make anything as awesome as on this thread? :'[[/QUOTE]
We have superior intelligence to you.
Yes soda, you should disagree because you don't.
[QUOTE=q3k;27414135]Yes, but since you're getting the value of the function for a specific argument (if not then you may be Doing It Wrong), you might as well take advantage that. It's not like a cos value magically appear in your code and your quest is to find the sin value for it. :v:[/QUOTE]
Could you clarify this? I don't understand what you mean...
Does anyone have any idea why Android would do this?
[img]http://gyazo.com/fff354e36dfafdc4299b672320dc412e.png[/img]
It does the same thing in the simulator and the emulator, with both pictures and drawing the gradient at runtime.
[QUOTE=Overv;27415529]Does anyone have any idea why Android would do this?
[img_thumb]http://gyazo.com/fff354e36dfafdc4299b672320dc412e.png[/img_thumb]
It does the same thing in the simulator and the emulator, with both pictures and drawing the gradient at runtime.[/QUOTE]
Apparently the emulator only supports 16bits like many Android devices. I think it would be best to save the gradient as 16bit in Photoshop (or whatever you are using) and enable dithering. I don't think there will be a noticeable difference.
[url]http://www.mail-archive.com/android-developers@googlegroups.com/msg45525.html[/url]
Sorry, you need to Log In to post a reply to this thread.