• What are you working on? v16
    5,004 replies, posted
Just created a particle system for an assignment i'm working on. Added parenting so you can attach the particle emitter to stuff and move it around :) [media]http://www.youtube.com/watch?v=iCCq9jcVCfs[/media]
[QUOTE=BlkDucky;28309300]Because even in daylight you can only see so far. Everything's scaled differently on the world map, like how in the early Final fantasy games the characters became the size of cities when in the overworld.[/QUOTE] Yeah, you're right. I wish I had your FOV code :saddowns:
[img]http://img716.imageshack.us/img716/8314/randommaze3.png[/img] Rooms now generate randomly and create doors accordingly. I also added a debug feature that will generate a new dungeon every time I click. Now I just need some help cleaning up the hallways that don't go anywhere.
[QUOTE=spear;28311635]Well, say I want to move an enemy at a certain speed - I'll probably want to put a sleep function in his walk and attack functions so that he doesn't teleport on top of the player and insta-kill him. If I put a sleep function in it with a single thread, the whole program pauses. Unfortunately, I can't find a straightforward tutorial on threads online, so I'll either have to devote a lot of time to the subject or pick up a book on it.[/QUOTE] Use delta time (time between each frame). E.g. you have something you want to move at 10 units a second, and one second is 1.0f, just get the delta time, something like 0.03f and multiply that by how much you'd like it to move in a second.
[QUOTE=KillerJaguar;28311872][img_thumb]http://img716.imageshack.us/img716/8314/randommaze3.png[/img_thumb] Rooms now generate randomly and create doors accordingly. I also added a debug feature that will generate a new dungeon every time I click. Now I just need some help cleaning up the hallways that don't go anywhere.[/QUOTE] The method I use is to check if a ground tile (water tile in your case) has three orthogonal adjacent wall tiles, and turn it into a wall tile if it does. I continue to do this in an up-down scan across the whole map while that condition is true.
[QUOTE=KillerJaguar;28311872][img_thumb]http://img716.imageshack.us/img716/8314/randommaze3.png[/img_thumb] Rooms now generate randomly and create doors accordingly. I also added a debug feature that will generate a new dungeon every time I click. Now I just need some help cleaning up the hallways that don't go anywhere.[/QUOTE] You could just have it start from each door and follow along one wall. If it gets to a different door, stop. If it gets to the same door, delete it. You could add the coordinates to a list as it goes or something and then fill them in. [editline]26th February 2011[/editline] You could also have it store all dead ends while it's generating the maze, and if you store from which direction each square was arrived at in an array, you could just follow the directions back while filling in until there are two adjacent squares without walls. This would let you do spear's method without having to loop through the entire maze several times.
[QUOTE=TVC;28311921]Use delta time (time between each frame). E.g. you have something you want to move at 10 units a second, and one second is 1.0f, just get the delta time, something like 0.03f and multiply that by how much you'd like it to move in a second.[/QUOTE] in my Android game I pull the system time into a Stopwatch class and run a tick method in every frame that grabs the current time and stores it in Stopwatch statically. Whenever I want a timer, I'll create a new int and calculate speed like this: [csharp]int interpTimeMs; //define this earlier in the code, when a movement initializes it, set it to current time float iterpDist = speed / 1000 * (Stopwatch.elapsedTimeMs - interpTimeMs); //converts speed in seconds to speed in milliseconds, multiply by the number of milliseconds that have passed to get exact distance traveled in one frame xPosition += interpDist; //do something with that value, in my code I use it as the scale for some vector math iterpTimeMs = Stopwatch.elapsedTimeMs(); //you'll have to update the timer each time otherwise movement will speed up exponentially[/csharp] [editline]26th February 2011[/editline] also, I'd like to mention how awesome C# generics are, especially for when turning XML deserialized objects into a game entity [csharp] public K initRenderMode<T, K>(T info, K ent) where T : EntityInfo where K : Entity { if (info.renderMode != null) { //do some stuff to ent based on info } return ent; }[/csharp]
I wrote this just for convenience. There's a site that can transfer text to speech. You can find it [url=http://www2.research.att.com/~ttsweb/tts/demo.php]here[/url] Unfortunately, it has a character limit of 300, and doesn't allow profanity. So I wrote a program that can take any amount of characters, removes profanity, and splits it up into chunks of 300 character segments. And downloads each chunk. [img]http://i54.tinypic.com/2z8te36.jpg[/img] Yeah, it's not big, it's kid stuff. But it saves me time from searching through bad words and removing characters by hand to work with a limit. By the way, as an inside joke, I replaced one of the voice selections with jallen. Also BlkDucky, you seem to really enjoy working on that project. I love seeing the improvements you're making to it. : )
[img]http://i56.tinypic.com/f0cm7n.jpg[/img] Made some more progress with my calculator! It now supports functions and variables (or constants). It still trips up when you try and call a function with the wrong number of arguments - too few and you'll get stack underflow, too many and you'll get stack corruption. It doesn't do unary minus yet, either, you have to do (0-1) or whatever :saddowns: Trying to write a validator for the infix expression but I'm spending hours on it and getting nowhere :/
Animations with C# Console Apps: [IMG]http://gyazo.com/d6ce16f5e0233f27e0b66eafc6e4b09d.png[/IMG] :downs: [editline]27th February 2011[/editline] Anyone wanna play Battleship? [IMG]http://gyazo.com/4c9e69218ccc88e595a717f2db40e190.png[/IMG]
mechanarchy: Are you going the tree route, using some in-place recursive traversal, or something really fun? :v:
Shooting Balls: [IMG]http://gyazo.com/c60740114e61ab2340cbb16e3b576ca0.png[/IMG]
[QUOTE=Night-Eagle;28318212]mechanarchy: Are you going the tree route, using some in-place recursive traversal, or something really fun? :v:[/QUOTE] I run a regex over the input (infix) string to split it up into numbers, strings of characters or individual symbols. Then I loop through that array and use the shunting-yard algorithm to convert it to postfix. When I evaluate it, I use the postfix version because it's super-easy. When I validate it I'm using the infix version, because it means you can see how many operators a function takes, as it's ambiguous in postfix. But, that having been said, it's being a massive bitch.
I'm working on a car-tuning game in flash. Nothing too complicated coz I'm a noob in action script. [img]http://www.upload.ee/image/1156868/garageProgressVolvo760.PNG[/img] The car on the picture is Volvo760.
Yeah
[QUOTE=Loli;28305982]Far from talentless... he was one of the best coders here, and certainly one of the best I know, but damn he knew it. That's what made him (you?) an arse hole.[/QUOTE] You must know like corner class coders or some shit.
geel, how did you get my steam details?
Urgh, trying to make my particle system more modular now. Not sure if I should load the settings from a file for each different particle type (emit chance, decay etc). Would this be a good idea or is it just overkill?
[QUOTE=mechanarchy;28318091]-image snipped- Made some more progress with my calculator! It now supports functions and variables (or constants). It still trips up when you try and call a function with the wrong number of arguments - too few and you'll get stack underflow, too many and you'll get stack corruption. It doesn't do unary minus yet, either, you have to do (0-1) or whatever :saddowns: Trying to write a validator for the infix expression but I'm spending hours on it and getting nowhere :/[/QUOTE] Does it support user-defined functions or variables yet? If not, that would be a cool thing to add, since I use that feature a lot on my calculator for repetitive function evaluations.
[QUOTE=AaRoNg11;28320822]Urgh, trying to make my particle system more modular now. Not sure if I should load the settings from a file for each different particle type (emit chance, decay etc). Would this be a good idea or is it just overkill?[/QUOTE] The way I've done it before (and this was a massively feature packed system) was to have all the settings for each particle type in a separate file. And by particle type I refer to emitters. I also had an inheritance system whereby 1 emitter inherited properties form a parent emitter, so you might want to think about that. It was XML so it was totally generic and you're just extract the properties you need in the runtime. Not sure if that was what you're asking about, but hopefully it helps. <Emitter Name="Fire" Parent="Base"> <Property Name="Velocity" Value="10,10,5" /> </Emitter> Something like that.
[QUOTE=AaRoNg11;28311687]Just created a particle system for an assignment i'm working on. Added parenting so you can attach the particle emitter to stuff and move it around :) [URL="http://www.facepunch.com/"]View YouTUBE video[/URL] [URL]http://youtube.com/watch?v=iCCq9jcVCfs[/URL] [/QUOTE] You should add some bool that either fixes the particles to the parent too, or only to the emitter so the particles are independent.
[QUOTE=CarlBooth;28320534]geel, how did you get my steam details?[/QUOTE] Searched for "carl" on the FacepunchStudios steam group.
He's also in SteveUK's friends list :v:
STEAM_0:0:5691597 hi carl
[url]http://steamcommunity.com/id/feedidy/[/url]
[QUOTE=SEKCobra;28322594][url]http://steamcommunity.com/id/feedidy/[/url][/QUOTE] He could change that. The steam ID I linked permanently links him, you just need to use a website to find his steam profile. Fuck year.
Or you could just calculate his community id.
Doesn't change the fact I still won't be adding you.
Think Löve will ever add a networking class? For multiplayer games
[QUOTE=Layley;28322816]Think Löve will ever add a networking class? For multiplayer games[/QUOTE] [url]http://love2d.org/wiki/LUBE[/url]
Sorry, you need to Log In to post a reply to this thread.