What are you working on? V4 (HTML ISN'T PROGRAMMING)
2,003 replies, posted
woaaaaaaaaaaaaaaaaaaaaaaaaaaaaah
[editline]10:55PM[/editline]
Don't create a new vector every time man!
You need to multiply the velocity by the frameTime, not the total elapsed time. That is - the amount of milliseconds it took for 1 frame. So you need a timer of some sort.
Are you using sfml? you can just do window->getFrameTime() if you are.
Anyway it would look more like this:
[cpp]
void Person::update( float frameTime )
{
velocity += Vector2(0,10) * frameTime;
position += velocity * frameTime;
}
... //game update loop
const float frameTime = window->getFrameTime(); //or however you calculate the frame time
player.update( frameTime );
[/cpp]
or a simpler example in your original format:
[cpp]
const float frameTime = <get the frame time somehow>;
person.velocity += Vector2(0,10) * frameTime;
person.Position += person.velocity * frameTime;
[/cpp]
you post cpp code using: [noparse][cpp]code here[/cpp][/noparse]
[QUOTE=compwhizii;17900154]what the fuck[/QUOTE]
You got demodded :cawg:
[highlight](User was banned for this post ("Thin line shit apple" - garry))[/highlight]
@Jimmylaw - you don't want totalseconds, you want elaspsed seconds. The total seconds means that *the longer the game has been running* the more your character will move - which is great for something like difficulty, and shit for normal movement. Elapsed time means that *the longer the time since your character was last updated* the more it will move, which is exactly what you want!
You might also like to think about doing a force based motion system - so gravity is running all the time, and the floor pushes upwards to stop him falling (this is actually the mathematically correct way of modelling rl).
[QUOTE=NovembrDobby;17907385]Why play a game when you can make an app to do it for you?
A little C++ project.
[media]http://www.youtube.com/watch?v=j_7d1SLxmVo[/media][/QUOTE]
THAT, is awesome.
[QUOTE=nos217;17907886]If you could make it more tactical this would be amazing.[/QUOTE]
I dunno, it's kind of hacky in its current state (like everything I make), I don't know how much more advanced I could make it.
I need to think of a proper way to identify jewels instead of hardcoding the colour for every single one.
[QUOTE=Dlaor;17915104]THAT, is awesome.[/QUOTE]
[img]http://www.facepunch.com/fp/rating/heart.png[/img]
[QUOTE=r4nk_;17915014]Helpful code[/QUOTE]
I am using C# which may explain why i was rather confused with your code example. So to get the frametime i have to find out how many frames its procressing in a second?
Jimmylaw - see my post. In XNA you get given it as a member of the frametime - you just need to multiply by the gameTime.ElapsedTime (or time since last frame, or whatever it is, I can't remember).
[QUOTE=Jimmylaw;17915183]I am using C# which may explain why i was rather confused with your code example. So to get the frametime i have to find out how many frames its procressing in a second?[/QUOTE]
Ohhhhhhhhhh that explains a bit :) I thought it was C++
Well I don't know what library you are using, and I don't know much C# so I'll wait for someone else to chime on how to actually get the frame time.
[editline]11:13PM[/editline]
ninjad
[QUOTE=arienh4;17913778]Rather, it's an iPhone-inspired UI, right? How about a button that adds another couple of rows every time it's pressed?[/QUOTE]
Sounds cool. I'll cook up some jQuery tonight. :)
Working on a GUI for my new game project, its going very well.
[img]http://media.tumblr.com/tumblr_krrs0jdBLp1qa4q72.png[/img]
It'll get a graphical upgrade at a later date.
Got unicode rendering in botch!
[img]http://img41.imageshack.us/img41/2008/19oct2009002.jpg[/img]
[URL=http://filesmelt.com/][IMG]http://filesmelt.com/downloader/onehundredpushups.png[/IMG][/URL]
First time doing Visual C++ .NET
This is only the layout though, haven't coded anything so far.
It's a little program to keep track of my progress in the One Hundred Push Ups program.
Doing this because otherwise I end up not finishing the program.
Also a question. Is there a simple .NET way of saving all the input in the text boxes or do I manually write the info of each and every text box to a text file.
Because that's 90 text boxes and I really can't be fucked doing that, not in C++.
[img]http://img39.imageshack.us/img39/9168/bot000.jpg[/img]
The aiming code next
[QUOTE=ThePuska;17916209]<image>
The aiming code next[/QUOTE]
I'm not sure I get it.
looks like he's making an aimbot
Looks more like the navigator from the game.
[QUOTE=Denzo;17916107]First time doing Visual C++ .NET[/QUOTE]
ughh not managed C++
[QUOTE=Denzo;17916107][URL=http://filesmelt.com/][IMG]http://filesmelt.com/downloader/onehundredpushups.png[/IMG][/URL]
Also a question. Is there a simple .NET way of saving all the input in the text boxes or do I manually write the info of each and every text box to a text file.
Because that's 90 text boxes and I really can't be fucked doing that, not in C++.[/QUOTE]
Loop through the controls on the tab.
Here's the C# way you'd do it:
[cpp]
foreach (TextBox textBox in tabPage.Controls)
{
string name = textBox.Name;
string value = textBxo.Text;
// process values, save them, etc
}
[/cpp]
Keep in mind you'll need to give each textbox a value for their Name members, otherwise it would be hard to know which is which.
[QUOTE=SteveUK;17916693]ughh not managed C++[/QUOTE]
Yes, it sucks ass, I know that. Just don't have a better way of creating a GUI.
Maybe I should use C# though, but I hate C# aswell.
[QUOTE=VoiDeD;17916916]Loop through the controls on the tab.
Here's the C# way you'd do it:
[cpp]
foreach (TextBox textBox in tabPage.Controls)
{
string name = textBox.Name;
string value = textB[B]ox[/B].Text;
// process values, save them, etc
}
[/cpp]
Keep in mind you'll need to give each textbox a value for their Name members, otherwise it would be hard to know which is which.[/QUOTE]
And if he hadn't already made the GUI he could have generated the GUI in a loop instead of the drag&drop editor and save even more time.
[B]Edit:[/B]
[QUOTE=Denzo;17916950]Yes, it sucks ass, I know that. Just don't have a better way of creating a GUI.
Maybe I should use C# though, but I hate C# aswell.[/QUOTE]
Qt?
Today I got in the high scores for a "Typing Challenge" Facebook app in one line of Javascript
[img]http://i35.tinypic.com/11tre69.png[/img]
Along with another cool guy by the looks of it.
Edit: The idea is to type as many words as possible in a minute.
Yeah! You spoil that game for everyone! And being a good citizen, I bet you even posted the bug to the developer of the application!
I suppose as this is the programming thread, people might have a sort of vague interest in what I'm doing.
Blog Engine in python using Google App Engine, with Mako for templates, and Textile for text formatting.
So far, it's going all right - I've had a couple of weeks break from it, and am getting back onto it. It's getting fairly feature complete.
It does pages with lists of synopses on them (so, only the first paragraph of each post), with a read more link, users can comment on the posts, and admins can delete them (I was thinking about adding captchas, but I'll have security through obscurity - yayyyyy!!)
Admins can list, add, edit and delete posts, and delete comments.
I'm currently adding tags for posts - for some reason, I can't get google app engine to recognise escape URL sections, although they're fine in get requests (wtf amirite?), so I'll use underscores for spaces, and keep the rest of the characters URL friendly by restriction.
Google App Engine's webapp framework is ... adequate. It does nothing exceptional at all (unlike many python web frameworks, and features - storm is a great orm, django has auto admin, cherrypy has a *really* cool way of building up urls, web.py is generally sort of flexible and nice), so if I were to do another big project on Google App Engine, I probably wouldn't use their "webapp" framework.
I would post a picture, but there's nothing other than the design to show. I'll open source it when it's done, but the code is fairly awful.
tl;dr TheBoff is writing a blogging engine.
Django.
What about it? I've used it - it's alright, not stunning. Autoadmin is pretty fucking kickarse though, although I prefer the general sort of structure/methods of web.py and CherryPy.
[QUOTE=garry;17915919]Got unicode rendering in botch!
[img]http://img41.imageshack.us/img41/2008/19oct2009002.jpg[/img][/QUOTE]
I like the progress of Botch.
[QUOTE=garry;17915919]Got unicode rendering in botch!
[img]http://img41.imageshack.us/img41/2008/19oct2009002.jpg[/img][/QUOTE]
I noticed the n on Item Seventeen is crammed right up on the edge of the listbox. If it goes over the length, will a scrollbar auto appear, or what?
I made a module for my IRC bot so it can automatically do a git pull, get the latest modules and reload them automagically.
[QUOTE=thelinx;17918152]I made a module for my IRC bot so it can automatically do a git pull, get the latest modules and reload them automagically.[/QUOTE]
I don't believe you.
It now calculates which hostiles are dangerous and highlights them
[img]http://img8.imageshack.us/img8/9246/bot001.jpg[/img]
It's also pretty good at shooting them, especially if they're moving.
The map data is too complicated for me to read, so I can't use it to determine whether the view is blocked by something. I think I'll just make it react to hostile actions: aiming for the bot's head, stopping, crouching and shooting. I think that if I can minimize its false negatives, it'll be able to shoot people who are about to shoot it, because it aims literally in milliseconds.
Sorry, you need to Log In to post a reply to this thread.