« first day (1065 days earlier)      last day (3970 days later) » 

12:10 AM
So... everyone go get Rogue Legacy. Tons of fun.
 
too expensive @ $15
 
But my current character is far sighted... everything within a certain radius of my character is blurred lol
 
lol, looks hilarious though
Too bad it's only single player, :*(
 
This would be really fun coop yeah
 
With multiplayer, I wouldn't even be talking with you right now
 
12:16 AM
haha
 
Sir Gordon has been slain by a McRib
 
@ToddersLegrande I sensed this.
 
#{!}%*#@!%^ - Sir Gordon's Parting Words
 
All special characters!? No!
 
12:22 AM
They've all got some goofy trait yeah
some of them with more impact than others
 
you should try Dungeons of Dredmor if you like that
aside from that, it's also a roguelike
one that is completely faithful to the classic recipe too
 
I'm a bigger fan of the action platformer genre
 
No one like shmup's with broken collision systems!?
 
And now I'm playing upsidedown
 
oh, okay then
try 99 levels to hell
it's on gog
 
12:26 AM
OH MI
The Byrds Turn!Turn!Turn
^_^ eeeeetss awessomeeee
 
1:01 AM
i like the lighting effects on that, Alex
2/1/15 with ziggs, ranked :)
 
yup, I'll give the game a try asap
I just hope the extreme metal soundtrack doesn't get annoying
 
i suspect it will, actually
:)
 
it's 4 am again, I'm off to sleep
cya
 
vyw
bye
 
1:44 AM
0
Q: Pyglet: Vertex_list.delete() not just removing specified vertex list from batch

Tom JohnsonI'm seeing odd behaviour when trying to remove vertex lists from a batch. Sample code to demonstrate the problem: import pyglet window = pyglet.window.Window() batch = pyglet.graphics.Batch() polys = dict() counter = 0 def add_poly(keycode, points): vertex_list = batch.add_indexed(4, pyglet...

A month ago, that question would have been closed as "Too localised". Now, it's on the brink of being closed as "Too broad". xD
Looking at more of the queue, it looks like we seem to be now using "Too broad" for exactly the code-dump questions which we used to close with "Too localised". Hooray!
Hm.. I guess it's a matter of marking the question as "you're not focusing down onto a specific question, you're just throwing code at us and asking us to find the question for you", rather than "answering this is only useful to one person ever." I guess I can kind of see that, in retrospect.
Doesn't match what the "Too broad" explanation field says, though. :/
 
 
2 hours later…
3:29 AM
:/ Not that it's a great question, but shouldn't we be trying to migrate gamedev question from SO, and isn't this a good candidate?
0
Q: How to know if the player is signed in?

Rotary HeartI was wondering if there's any way to know if the "player" is signed in or not? Something like this: if (GamePad.GetState(PlayerIndex.Two).IsConnected && !Gamer.PlayerTwo.IsSignedIn) Edit: This way the controller is connected (the player can use the controller), but it's not signed in to any...

If we want this community to grow, I think we should be trying to merge on-topic gamedev questions that are posted on SO over here
I plan to reply: "That's exactly what gamedev.SE is all about: questions related to making games, and nearly all of those are about programming."
sent
 
3:54 AM
@JohnMcDonald yeah I dunno :|
This site is suffering an identity crisis
I mean... I don't think were supposed to migrate game dev specific programming questions (like the one you linked) from here to SO
Feels more appropriate here myself
 
I'm trying to bring questions HERE
 
I agree with your conquest
I don't understand mcmonkey's reluctance to migrate though I guess is my point
We wouldn't move that question from here to SO so why can't we migrate it here from SO
 
(I think in your original comment, you meant to say "from SO to here"?)
 
No I meant what I said... it was a worse way of saying my last statement in the last block of messages
1 min ago, by ToddersLegrande
We wouldn't move that question from here to SO so why can't we migrate it here from SO
 
Right
 
4:01 AM
oh wait
 
I've been having trouble with this site over the past six months or so. Feels like it's been slowly turning from being about making games to being about how to use game-making tools. Which is a pretty subtle distinction, I guess.
 
nevermind. I can't read
 
Don't know. But between not really knowing XNA and not using Unity, it often feels like there aren't a lot of questions I'm equipped to answer.
 
I'm also really not equipped to answer a lot of the questions that come through here either
 
I see more mobile type stuff come through I think. I can't answer any of that
Objective C just scares me
 
4:05 AM
Well... our friend just cross-posted
shrug, I kinda advised him to, :/
 
Wooooooooooooooooooooooooooooooooo
This is why I just hang out in chat
 
I'm tempted to flag the SO one as a duplicate...
lol
 
You flag the SO one as a duplicate, I'll flag the GD one as a duplicate, and with luck, we'll have a circle of duplication. ;)
 
heh, I remember doing something like that with remote desktop and ended up with 2 black screens
 
4:10 AM
@JohnMcDonald were you working on an answer for that or just migrating it?
 
I was just working on migrating it, I don't know much of anything about consoles
I was even about to ask if other games on the XBox can do it
 
I like to think I'm good at working my way around MSDN so I think I've found something that might help...
 
Ew, MSDN. :)
 
heh
Yeah, don't search MSDN if you know what's good for you. Google MSDN
 
++
Its exactly what I do
 
4:14 AM
I only search MSDN when I'm trying to figure out what horrors Microsoft wrought in their efforts to avoid complying with C standards post C89. ;)
 
@ToddersLegrande I wonder if Microsoft knows that programmers know to do that?
heh
 
It's like 80% figuring out the various bugs in their various snprintf() replacements. And exactly which version of Windows it is where they added 'poll()' to WinSock2 (Vista. No poll() for you before Vista)
<-- working on cross-platform projects which have to support back to Windows XP. No poll() for me. :(
 
ehh, fun times, :(
 
Honestly, I should just implement my own properly-working snprintf implementation for use on Windows. I bet there's a free one out there already, even. poll() would be harder, though. (am currently using select(). Which is going to be awful for running on a server with lots of clients; I'm going to need to replace that with something platform-native on each platform, I imagine)
 
sounds to me like there should be a platform agnostic networking framework out there
 
4:19 AM
If I asked on StackOverflow, I'd be pointed at boost::asio. But ew.
 
using something like 0MQ as a slightly higher-level layer be an option?
 
Catching up on your blog @TrevorPowell and can't help but notice that your Dudes look like Mooninites:
 
Heh.. that hadn't occurred to me!
Honestly, they're still just placeholders. Not even animated yet. :)
 
heh, right on. Ahhh, mooninites. :)
 
Damn you LINQ!
 
4:23 AM
@Jimmy I like 0MQ, I think. I haven't done a lot with it yet, but it seems like a really clever solution to a whole lot of problems. But I don't think I'd want to use it for networking in a game.
I guess it'd depend on what the game's requirements were, actually. Maybe it could be made to work. :)
 
"Maybe it could be made to work" is one of those phrases that makes me nervous
 
For most game usage, I just want to spam UDP packets at my peers. Don't need the weight of message dispatch. :)
 
x => x. isn't triggering any intellisense and I dont know if somethings going wrong or not...
 
Usually yes, but try ctrl+space
 
In my experience, intellisense is neither intelli nor sense. (but mine is admittedly a minority opinion on the topic)
 
4:26 AM
@Todders you can also trick it a bit by closing the paren i.e. Select(x => x) and then triggering intellisense again
 
@TrevorPowell heh, you're talking to the proud owner of intellisenseless.com (Todders that is)
 
I can code in an editor without Code completion/Intellisense, but I like being able to not remember the full names of large APIs
 
yeah, I can (mostly) too
 
My brain is used for solving actual problems, not for remembering the difference between different overloads for WebClient.UploadString
 
@JohnMcDonald The bit that kicked me over the edge was running CodeWarrior (PS2 development), and while typing "2.0f", the computer ground to a halt as soon as I typed the '.', disk thrashing nonstop for about five seconds, while the computer (presumably) tried to figure out whether '2' was a structure or class, and whether there were any fields it could prompt me to enter. Have had all automatic code completion turned off in everything since then.
 
4:29 AM
The problem I know when intellisenseless isn't working something is likely wrong... I just don't know what it is
 
@TrevorPowell :O
 
@Todders I've gotten used to it sucking at completing stuff inside a half-written lambda inside a half-open parentheses pair
 
Yeah, that makes sense, @Jimmy. I just solve those problems by choosing not to work in languages/libraries which require me to remember such things. But that's becoming less and less an option, these days.
 
        if (Gamer.SignedInGamers.Select(x => x.PlayerIndex = PlayerIndex.Two).Count == 0)
        {
            //do it
        }
I suck at lambda lol
 
!Gamer.SignedInGamers.Any(x => x.PlayerIndex == PlayerIndex.Two)
 
4:31 AM
It doesn't like the .Select (I've also tried just .count with the lambda in parens)
 
"not any" is faster than Count == 0 because it exits the loop early
also, "==" versus "="
is SignedInGamers an actual IEnumerable<T>?
 
I was just heading down that way
it shows the extension methods in intellisense... just doesn't like my parameters
 
if it's an untyped IEnumerable, you have to cast it using SignedGamers.Cast<Gamer>() first
 
.Any(x => x.PlayerIndex == PlayerIndex.Two)
 
hmm
 
4:32 AM
Error 1 'Microsoft.Xna.Framework.GamerServices.SignedInGamerCollection' does not contain a definition for 'Any' and no extension method 'Any' accepting a first argument of type 'Microsoft.Xna.Framework.GamerServices.SignedInGamerCollection' could be found (are you missing a using directive or an assembly reference?) C:\tyler\dev\PlatformerEngine\PlatformerEngine\PlatformerEngine\Game‌​Objects\Input\BasePlatformerInputHandler.cs 22 22 PlatformerEngine
 
@Jimmy heh, didn't read
 
The casting might be it
It extends GamerCollection<SignedInGamer>
 
which probably implements IEnumerable but not IEnumerable<SignedInGamer> ?
 
IEnumerable<Gamer>
 
either that or you haven't included System.Linq
 
4:33 AM
System.Linq is there
 
first thing I checked :)
 
Does "Any" show up in the dot complete for SignedInGamers?
 
Yessir
Casting did it
        if (!Gamer.SignedInGamers.Cast<SignedInGamer>().Any(x => x.PlayerIndex == PlayerIndex.Two))
        {
            //What you want to do now
        }
Thanks guys
Going to note that one in the back of my head
0
A: How to know if the player is signed in?

ToddersLegrandeIn XNA there is a SignedInGamer class with a SignedInGamer.PlayerIndex member that should tell you just that if you can get a hold of the SignedInGamer object. To do that, there is the Gamer.SignedInGamers static property which contains a collection of SignedInGamer objects based on the current ...

Apparently GD.SE is "for really nooby sounding game-programming questions"
I feel a meta post coming on
 
Todders
have you read the doc for Gamer.SignedInGamers?
it guarantees sortedness
 
4:40 AM
But it doesn't guarantee the record exists?
Are you saying a loop would have been just as good?
 
you just have to check if Gamer.SignedInGamers.Count > 1
oh i see
 
Player 3 could be signed in and player 2 isnt
 
makes sense
 
Theoretically..
@JohnMcDonald are you gonna put together a meta question or anything around mcmonkeys latest comment? I'm curious what the "official" stance on that is
Or what are your thoughts?
 
heh, yeah... wow
I was about to press send on "Is there ever a reason to move a question from SO to gd.SE then?"
 
4:48 AM
Yeaaaah...
 
and I've been thinking about putting a meta together
 
the intersection of "game-dev related question that isn't coding" and "not overly subjective or broad" is pretty small
 
6
Q: Is game development no longer relevant on SO due to the creation of Game Dev SE?

SpeedBirdNineI have noticed recently that people at Stack Overflow usually move questions related to game development to Game Development SE. So are questions related to game development no longer appropriate at Stack Overflow? If this is the case, Questions related to programming, DirectX or OpenGL etc ar...

"[...] requires knowledge of Unity, rather than general programming knowledge, and would generally be better served by Game Dev."
I feel like a game dev API would fall under the above category proposed by the accepted answer of that meta post
 
The big problem I see with the accepted answer to the meta you just posted, is that a huge portion of these users have no idea that GameDev even exists
 
79
A: Programming Questions: Here or "Belongs on Stackoverflow"?

AlconjaI feel quite strongly that GameDev should cover all aspects of "game development" (note the site isn't called "game design"), which should absolutely include programming. Just because there's another SE site that already covers some related topic (i.e. SO in the case of programming), doesn't mean...

 
sm4
4:53 AM
Every user who ever answered any game related question on SO should have GD account automatically created.
 
@JohnMcDonald I agree with your statement
 
Before finding this website, I was checking out the XNA, Pathfinding, and Networking tags on SO. It was only when one of the questions I clicked on was migrated here that I realized this world existed
 
"Would a professional game developer give me a better/different/more specific answer to this question than other programmers?" - I feel like XNA, DirectX, OpenGL, and those types of things would all fit under this statement. Mobile dev is the bigger grey area.
 
Mobile dev in general, I can't say, but mobile gamedev? Yeah, I'd like to see more of it here
 
sm4
BTW I feel like Android development should have its own SE site, because SO is totally flooded by simple questions about Android.
 
4:56 AM
I can't say I know anything about mobile gamedev, but
Right
 
Well I guess thats my point. There is a set of APIs for Android, IOS, etc. I wouldn't vote to migrate "game dev" questions that are on SO using these APIs unless it was absolutely something game dev specific (hence the grey area). Given the statement I quoted above, I would definitely have the XNA Sign in Question flagged for migration
 
yeah I remember a time when the top 10 most viewed on SO were like 80% android
 
"I'm making a game" doesn't constitute it as a game dev programming question
 
*just posted android question feeling guilty.
 
4:58 AM
you are destroying america
 
and on Worldwide Freedom Day, too
 
@ToddersLegrande Mm. Gamedev is like a boat. :)
 
shame shame
 
:'(
 
4:59 AM
@BlueBug heh, that looks perfectly on-topic here
 
@TrevorPowell well, it's been established that boat-programming is off-topic for SO
 
My point precisely. :)
 
which was sad, since I liked the boat-programming question :(
 
@JohnMcDonald me posting question || the question i posted?
 
I just mean.. questions about how "if" statements work (for example) aren't about games just because you're going to use them in a game. Same way that questions about how "if" statements work aren't about boats just because you're going to use them while you're sitting in a boat. ;)
 
5:01 AM
@BlueBug The question you've posted on the site
 
oh, that's different from what I meant
one of the most famous Stackoverflow closed questions was "I'm going on a boat for a year, what kind of equipment do I need (salt-tolerant) etc. so I can program on a boat"
 
laptop perhaps, a sort of portable computer device.
 
sm4
@Jimmy Was it closed or migrated to "programmers"?
 
I believe programmers didn't exist at the time
 
??????????
 
sm4
5:05 AM
:D
 
68
Q: What is the boat programming meme about?

Michael StumI remember some time ago there was some huge problem regarding some question that had something to do with a boat, and I think I missed that topic completely. As I see it being mentioned every now and then, I'd just like to know what it was about.

 
is "programmers" a term that I am not aware of?
 
sm4
Context. It is a SE site.
 
@BlueBug Programmers.StackExchange
it's where the unwanted SO questions go to die
even though their FAQ explicitly says that is not the case
 
@Jimmy Yeah, it's kind of backwards from the boat programming meme, which was about whether boat questions were on-topic if you were asking in order to program while on the boat. :)
 
sm4
5:07 AM
@Jimmy From this Q&A it looks like that [boat-programming] is an implicit tag on Programmers.SE :)
 
...they should totally map boatprogramming.stackexchange.com to programmers.stackexchange.com :)
 
that's where stackoverflowoverflow.com goes to now
I think the original owner was offering to mirror all the 'deleted-for-being-off-topic' questions there
but again, that was before programmers.SE
 
...my Walking Dead save didn't save completion of the last episode, apparently. Now I have to play that last episode again. :(
And I need to decide whether to do everything the same, or whether to make different choices, I guess.
(Not that I actually remember what the choices were, mind you)
 
sm4
BTW somebody was asking a question on GD about stealing ideas (the Kickstarter cold feet question). I have posted an asteroids bookmarklet game here some time ago. Now I have found almost exact copy of it, just different graphics and under a very well known company name... Now I wonder if they bought it or stole it (and who from whom :))... here it is: m-ms.dk/spaceheroes
Which brings me to a question: How to protect HTML5/Javascript games from piracy?
11
Q: HTML5 App Anti-Piracy techniques?

MarcusBoosterI'm writing an HTML5 based game that runs as a stand-alone application. It is distributed via the web, but there are no other server requirements—no database, etc.—everything is "in-app". This is by design since additional servers would raise the cost of distribution. So given that it's just a s...

^ Related to the GD vs. SO discussion before. Notice it starts: "I'm writing an HTML5 based game..."
 
:/ yeah
That question can be (and has been) answered by non-gamedevs. HTML5 security is a common concern
 
5:23 AM
This is also something that gets asked every 10 minutes about Java too
or .NET
 
There are certain questions that can't be reasonably answered by someone outside the field, but where is that line and how do you determine yay or nay
I think detecting if a player is logged in to their XBox using XNA is one of those questions
meta tomorrow morning
 
sm4
I wonder how many people in GD site are actually "in the field" :D
 
but I've got to sleep. gn
heh, well, there are people that have tried to write a game, and those that haven't
shrug
gn
 
5:47 AM
RE: Walking Dead not saving completion.. nope. Continuing that "Episode Four" save game left me right at the end of Episode Five, answering the final questions. Weird.
 
 
4 hours later…
sm4
9:23 AM
Polybius is a supposed arcade game featured in an Internet urban legend. According to the story, the Tempest-style game was released to the public in 1981, and caused its players to go insane, causing them to suffer from intense stress, horrific nightmares, and even suicidal tendencies. A short time after its release, it supposedly disappeared without a trace. Not much evidence for the existence of such a game has ever been discovered. Polybius gets its name from the Greek historian who, among his other works, was known for his works in relation to cryptography and for developing the Pol...
 
9:41 AM
lol
 
sm4
10:04 AM
@Gajoo I always thought the hard part in programming is to write the code that is easy to read.
 
@sm4 it really is hard to write an easy to read code.
but sometimes, the code itself is not that hard, it's just an implementation of a complex mathematical solution.
in these cases either you know the algorithm or not, if you already know what that code is supposed to do, it's just easy. otherwise you can't even tell why is that code working.
consider a code solving "0 = a*x^2 + b*x + c"
it's as easy as writing :
x_1 = (-b + sqrt(b^2 - 4 * a * c)) / 2 / a
x_2 = (-b - sqrt(b^2 - 4 * a * c)) / 2 / a
if you see that piece of code you can't really blame the developer if you don't understand what it's doing.
well he could write it in a cleaner manner for example by using one or two extra variables but in the end you either understand what is happening or not, commenting won't actually help :|
 
sm4
Well, if you use prolog, it's more obvious:

Int1 is 2*A,
Int2 is B^2 - 4*A*C,
Int3 is sqrt(Int2),
R1 is (-B + Int3) / Int1,
R2 is (-B - Int3) / Int1,

print('R1 = '), print(R1), nl,
print('R2 = '), print(R2), nl.
Or not :)
 
@sm4 you are just using the extra variables I mentioned, it's not really more obvious (at least in my opinion)
 
sm4
I was just trying to find the most obscure language example or quadratic equation solving I know :)
right, it's the same.
 
 
3 hours later…
1:22 PM
oh no someone found and took my dare
Does anyone get the movie reference (without looking it up)?
 
not me :(
 
The reference is in the starred comment over there.
just in case that wasn't clear :)
 
1:49 PM
summer storm coming in
99% of the sky is covered in dark clouds
estimated time without internet: 5 hours
estimated time without electricity: 2 hours and then 1hr episodes until the next day
not fun.
 
2:15 PM
what do you do when you try everything 4 times, and it doesn't work. Then the next day, you try the same things, and it works. Then a month later you try, and it doesn't work. Then you try everything 4 times again. Then you wait till tomorrow and try the same things again, and this time it doesn't work.
really getting angry about this now
oh... with the 4th, i bet a lot of people took friday off.
quiet in here except for the non-US regulars.
 
hey all!
 
hi pip
okay, the storm stopped
waiting for every single thing to fail any moment now
actually, nevermind, I forgot how things work in my old town
when there's a huge storm, everything works
when there's a bit of rain, electricity goes down
 
2:30 PM
:D
yesterday, i hit 125 rep. Today, i hit 15 badges :D
 
2:47 PM
ok starting from scratch with an entirely new project, I can get the buttons to work
so now I have something to go on.
 
3:09 PM
but i still don't see differences in the way they're implemented
oooh... it's not the editor saving incorrectly. Transplanting the .ccbi that works in one project to the project where the other doesn't work... doesn't work.
and transplanting the ccbi that doesn't work to the project when the other does... works.
Ok! So the editor part is working fine.
 
3:32 PM
okay this is a real noob question, but if one includes a header in one file, would the parent of the parent of that file have access to the functions from the included one?
 
what's a parent of a file?
 
one that includes it
one second.
 
if in something.h you include blabla.h
and in wow.h you include something.h
you can access what's in blabla.h through wow.h
 
what he said
 
so THAT'S why. that was driving me insane.
 
3:34 PM
parent's the wrong word, since .h files get copied in wholesale during the preprocessing phase.
 
got it
 
:)
 
seems difficult to get rid of redundancy that way, but I guess that's what the #ifndef line is for.
 
blabla.h .. nice ;)
 
lol had to pick something quick
 
3:35 PM
yup, that's why you get the ifndef. nice in obj-c is #import won't do it twice by defautl.
 
I believe Microsoft has that #pragma once directive which does the job of ifndef
but I have heard reports of bugs related to it
 
yeah, wiki says #pragma once isn't standard, but widely supported, not just by MS
 
first met it in VS, maybe that's why I though it was MS only
 
might have started there, I dunno. seems a lot of compilers take VS as their example.
 
the most annoying part of every app I have to develop is the GUI
especially when I have to do bullshit like resizing and cropping images
 
3:39 PM
Happy Friday
 
yay!
 
eh, I did a lot with image processing before. I had a signature shop on an RS forum for a while, and got to an okay level. nothing amazing. can't say I'm afraid of GIMP or Photoshop.
what drives me insane is positioning, especially when trying to make it work on screens of many different sizes.
 
I used to do fake pics in Paint on RuneVillage's forums
this was back in 2005
 
I think this signature was my best work, though I'd probably change the characters in it now.
 
what drives me insane is if there was just a bit of competency at the root of this project's management
 
3:42 PM
lol, competency in management...
 
I would have told the graphics designer what artwork I need and in what sizes
and I would've received it
but no
 
actually the place I work has great management, but it's not tech work.
 
it's just me, and an assistant who is seemingly scared of her boss
and low quality artwork
@IcyDefiance yeah lol
though everything I got before this went more smooth
there's a beginning for everything I guess
 
I found #pragma once in Codewarrior 10 academic around 1997 or something
 
I don't do a lot of C++ in VS, so I mostly use #ifndefs
but I always thought #pragma was more #pragmatic
 
3:51 PM
Anyone else having some CSS issues on the SE network today?
Eh... I think Chrome is acting up
Weird. I can't seem to correct the problem
 
using chrome, and I don't see anything
 
works well for me
 
:(
Works fine in IE
 
IE! hahahahaha
 
I think I got it
Appears that the developer tools "Clear Cache" and "Clear Cookies" is more powerful than the plain old browser "Clear Cache" and "Clear Cookies"
Also, when did this show up? How far behind am I?
 
3:58 PM
pretty sure I saw that the first time I visited. it's just there when not logged in or something.
that was...I dunno, late last year?
 
@IcyDefiance you are right. Log in and its gone
I notice a giant minimize button. I wonder if I had to have pushed it while logged in...
 
@ToddersLegrande a couple of months ago
 
Hmm... still having issues on meta.gd.se
This is obnoxious
 
I see that page whenever I try to open GD and my computer time is messed up.
 
and now it works and I didn't even do anything
amazing
Chrome is full of tricks today
now GD.SE isn't working again........................................................
I should just go home
 
4:08 PM
Yus so I fixed collision. SAT
COLLISION!
 
@ToddersLegrande I am lucky I stuck with small maps. If not I would have to implement octree's or something to optimize the collision detection
but I can detect if the player is far away from the collision rects
is touching one of them
or is intersecting one of them.
Want me to post some codez? I used braces!
ᕙ( ^ₒ^ c)
(─‿‿─)
Oh wait.. I'm actually going to have to optimize how collision works :X
I guess I'll make a huge rect around the player and then just solve collision for the rects that enter that rect
profit!
 
you'll still have to iterate through all the rects to see if they collide with the big one, right? wouldn't that make things worse?
 
I guess... I am unfamiliar with collision optimization.
 
hey all!
 
4:23 PM
what I usually do is put the collision detection as part of the movement code. like do the movement in temporary variables, check for collision on those. if it doesn't collide, return the temporary variables; if it does, return the originals.
that's about all the advice I can give without seeing more details.
 
So precalculating the player's position?
like if he is moving up... Vector2(player.x,player.y + 1);
Then check to see if that position is within a rectangle?
 
I think you're thinking of the right thing... lol
instead of calling a function to move the player, then calling a function to check for collision, as separate things
make the collision detection part of the movement function
this also solves the problem you were having earlier about figuring out where to place the player when he collides with something. since you can just make him stop. (or make him slide, since that's usually more desirable)
this is all theory, though
 
Okay - I'll try it.
 
here's a related example, for rotating a piece in my tetris clone:
if (rotate)
	{
		m_FallingPiece->Rotate();
		fallingPositions = m_FallingPiece->GetPositions();
	bool invalidRotation = false;
	for (int i = 0; i < 4; i++)
	{
		if (fallingPositions[i].x < 0 || fallingPositions[i].x > 9 || allingPositions[i].y < 0 || fallingPositions[i].y > 19)
			invalidRotation = true;
		if (m_Grid->GetColor(fallingPositions[i]) != CL_EMPTY)
			invalidRotation = true;
	}
	if (invalidRotation)
		m_FallingPiece->UndoRotate();
it rotates, then check if the rotation was invalid (ie. if it collides with another piece, or goes outside the walls), and if it does, it undoes the rotation.
 
4:51 PM
thanks man - I think I'm getting it to work :D
 

« first day (1065 days earlier)      last day (3970 days later) »