• What are you working on? v16
    5,004 replies, posted
Carl can't be rated dumb but the swathes of dumbs I get on every post despite content is fair?
[QUOTE=Dlaor-guy;28565460]About time.[/QUOTE] If this is bannable then why is Soda not banned? :v:
How would I handle being only able to jump once(no double, or triple etc jump)?
[QUOTE=geel9;28566690]Carl can't be rated dumb but the swathes of dumbs I get on every post despite content is fair?[/QUOTE] I really don't get all the dumb-ratings, hated-people, and "That guy is a faggot" "meme's" , so I think no. [editline]12th March 2011[/editline] [QUOTE=neos300;28566902]How would I handle being only able to jump once(no double, or triple etc jump)?[/QUOTE] if (!inAir) Jump(); Jump -> bool inAir = true, Hit the ground -> inAir = false;
[QUOTE=geel9;28566690]Carl can't be rated dumb but the swathes of dumbs I get on every post despite content is fair?[/QUOTE] He was banned because he was [url=http://www.facepunch.com/threads/1064434-VB.net-MySQL-DB-Query?p=28442422&viewfull=1#post28442422]butthurt[/url] and acting like a child.
I just realised the usefulness of texture coordinates, and now I'm able to render tiles! (I did take a few hours break, I'm not just really slow): From this: [code]00000000000 00001110000 00011111000 00110101100 00111111100 00110001100 00011111000 00001110000 00000000000[/code] to the slightly better this: [img]http://filesmelt.com/dl/tilegame.png[/img]
If you have too many digits in either direction, does it resize to fit them?
[QUOTE=aero1444;28567056]I just realised the usefulness of texture coordinates, and now I'm able to render tiles! (I did take a few hours break, I'm not just really slow): From this: [code]00000000000 00001110000 00011111000 00110101100 00111111100 00110001100 00011111000 00001110000 00000000000[/code] to the slightly better this: [img_thumb]http://filesmelt.com/dl/tilegame.png[/img_thumb][/QUOTE] Surely doing it this way limits the number of tiles you can have to 10?
Now Supports OPML feed list Import: [img]http://f.anyhub.net/277E[/img] It's just downloading all the posts for my 40+ subscriptions I imported from Google Reader. I've not tested it on mono yet, but if I get it working would anyone like to try it?
How do you detect if two objects have collided in Box2D? I looked at sensors but that doesn't really seem clear.
[url]http://www.box2d.org/manual.html#_Toc258082970[/url]
[QUOTE=BlkDucky;28567272]Surely doing it this way limits the number of tiles you can have to 10?[/QUOTE] that's just the output of the program (for testing purposes), the real map looks like this: Example Map;11;9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 first line is the name, width, height, then the next rows are the tile ids separated by spaces.
[QUOTE=s0ul0r;28567607][url]http://www.box2d.org/manual.html#_Toc258082970[/url][/QUOTE] Shape point test, contact manifolds, or what? I've been through that whole section, and I still don't really know what I should use
[QUOTE=Quark:;28567158]If you have too many digits in either direction, does it resize to fit them?[/QUOTE] It works as a square, so it just tells you it couldn't load the map. I'd probably end up just adding "null" tiles (e.g. -1) to tell the game not to render anything there.
So as long as there are equal rows to columns and equal digits in each row it'll load?
[url]https://github.com/mtwilliams/World-of-Mana/blob/master/WoM/Map.cpp[/url]
[QUOTE=Dlaor-guy;28564728]I just noticed how ridiculously simple du/dv mapping is. In fact, I just implemented it in my game. Here's the shader code. [cpp]uniform sampler2D texture; uniform sampler2D normalmap; void main() { vec2 pos = gl_TexCoord[0].xy; vec4 normal = texture2D(normalmap, pos); pos.x += normal.r - 0.5; pos.y += normal.g - 0.5; vec4 tempcol = texture2D(texture, pos); gl_FragColor = tempcol; }[/cpp] That's it! Now you have du/dv mapping! To make your average normal map work for this, simply invert it.[/QUOTE] Here, lemme demonstrate: Picture without du/dv [img]http://i.imgur.com/jBfsE.png[/img] Picture with du/dv [img]http://i.imgur.com/C5wcu.png[/img] Du/dv map [img]http://i.imgur.com/CWsbi.png[/img] I think I'm going to use this to make explosions just a bit more juicier.
Got an interesting problem. If I tap my jump key, it works fine and I jump and cannot jump again until I reach the ground. But if I hold the jump key down while it is jumping, Box2D won't register the collision for some odd reason.
[QUOTE=neos300;28568903]Got an interesting problem. If I tap my jump key, it works fine and I jump and cannot jump again until I reach the ground. But if I hold the jump key down while it is jumping, Box2D won't register the collision for some odd reason.[/QUOTE] I think there's a bug in your code!
Actually, I think this has something to do with my boolean logic. Maybe I could just apply a small force to the object every frame to keep registering the collisions, so it would still work?
[QUOTE=Richy19;28563908]500.000 and 5fps :O [/QUOTE] Drop it to 50000 and your FPS will probably grow quite a lot. Five hundred thousand particles is overkill for almost anything. [editline]12th March 2011[/editline] Rong paeg
It only happens when you hold down the key throughout the jump, until it touches the ground. [editline]12th March 2011[/editline] :argh: my automerges
[QUOTE=neos300;28568946]Actually, I think this has something to do with my boolean logic. Maybe I could just apply a small force to the object every frame to keep registering the collisions, so it would still work?[/QUOTE] That method (using a bool to keep track of a jump) is really bad. What you should do is check if the player is colliding in manner that lets him/her jump and if he/she is then apply a force. It's much cleaner that way and some optimizations like quad trees can make it quite fast.
[cpp]bool Player::onCollision(BaseOBJ* obj) { if(obj->name == "phys_static") { jumping = false; } return false; } void Player::jump() { if(jumping != true) { ApplyForce(Vec2(0.f, -13000.f), Vec2(0.f, 0.f)); jumping = true; } } [/cpp] Here's my code, I can't see why this wouldn't work. onCollision is called first, by the way.
Learning directx, it's a fucking brainfuck so far. :byodood: I'm not sure if i'm just stupid or if it's something that just suddenly makes sense. I understood it perfectly well up until the chapter about making a triangle. :v: [img_thumb]http://img34.imageshack.us/img34/417/dattitle20110312224313.png[/img_thumb]
Shouldn't be something like: [cpp] bool Player::onCollision(BaseOBJ* obj) { if(obj->name == "phys_static") { jumping = false; return true; } return false; } [/cpp]
[QUOTE=esalaka;28568971]Drop it to 50000 and your FPS will probably grow quite a lot. Five hundred thousand particles is overkill for almost anything. [editline]12th March 2011[/editline] Rong paeg[/QUOTE] yea, that was mainly a stress test to see how far i could go before it just dies on me :v:
[QUOTE=DevBug;28569043]That method (using a bool to keep track of a jump) is really bad. What you should do is check if the player is colliding in manner that lets him/her jump and if he/she is then apply a force. It's much cleaner that way and some optimizations like quad trees can make it quite fast.[/QUOTE] so basically onCollision(obj) if(obj = ground) can jump = true jump() if canjump = true apply force ? [editline]12th March 2011[/editline] [QUOTE=DevBug;28569095]Shouldn't be something like: [cpp] bool Player::onCollision(BaseOBJ* obj) { if(obj->name == "phys_static") { jumping = false; return true; } return false; } [/cpp][/QUOTE] The return value is for it should collide or not, for effects and whatnot [editline]12th March 2011[/editline] PAGE 39, ARISE oh wait automerge
Something like that; Personally, I would roll my own physics engine to remove the need for callbacks and thus messy variables. For more legroom: OnCollision(Obj) CollidingWith = Obj Jump() if(CollidingWith == "ground") if(CollidingWidth.y > this.y) ApplyForce(0, 0, -900 - 100)
[QUOTE=DevBug;28569161]Something like that; Personally, I would roll my own physics engine to remove the need for callbacks and thus messy variables.[/QUOTE] I tried to make my own, failed. The callbacks to the entity are there because I have a global collision manager and it simply calls the onCollision method on every object that is being collided. Also that other solution didn't work.
Sorry, you need to Log In to post a reply to this thread.