Jump to content

  • Log In with Google      Sign In   
  • Create Account


freeworld

Member Since 06 Sep 2007
Offline Last Active Mar 23 2014 11:51 AM
-----

#5072864 Name of a particular property

Posted by freeworld on 25 June 2013 - 04:35 PM

How does the documentation for std::cin describe it?


#5044082 Are Certain Constants Really Necessary ?

Posted by freeworld on 17 March 2013 - 06:30 PM

Servants example is the biggest reason I use such constants. I will also do this a lot for variables I know later ill be loading from a config file... but in the need to get things tested asap ill use constants then later remove the constant and make it a member variable once i got the settings-loading code in place. This assumes it won't be used anywhere but the given file.

More of a place holder in bigger projects. In smaller projects I do it to keep all those variables I know ill have to tweak over and over again in one clean place.... so as servant said I don't have to hunt for them.

Edit... derp servant I didn't read your whole post.... atleast I'm your new fan boy ;)


#5035799 is the size of my tile messing up the collision?

Posted by freeworld on 23 February 2013 - 11:52 AM

No matter the size, if two quads are overlapping, they're overlapping....

 

What I've always done for BB checks that don't rotate is first check if the quads overlap, then check where they overlap. I split my quads up into two points , the upper left and the lower right corners.

 

obj1.x1

obj1.y1

obj1.x2

obj1.y2

 

and do the same for object 2 (the second quad).

 

then to check if the two quads overlapp

 

 
if (obj1.x1 <= obj2.x2 && obj1.x2 >= obj2.x1)
{
    if (obj1.y1 <= obj2.y2 && obj1.y2 >= obj2.y1)
    {
        // Quads overlapped
    }
}
 

 

The overlap assumes that if they overlap the object 2's left side will always be to the right of object 1's left side and so on for the rest of the sides. Then to check which side collided you would use the same concepts, just that it's possible for shapes to collided on multiple sides even all sides with this check, but it's fast and simple, just needs a little babbying which can be done with a sweep test to find the exact point when they collided so it doesnt overlapp so much that it'll collide with multiple sides.

 

if object 2 hit the top of object 1, you can assume the top of object 2 should be above object 1, else it probably hit the bottom of it.

 

if (obj2.y1 < obj2.y1)
   // object 2 hiot the top of object 1

 

I've been getting rusty on my writting, so if any of that doesnt make sense, just ask and ill try to specify.




#5035500 Need some motivation

Posted by freeworld on 22 February 2013 - 12:34 PM

Youre perfectly normal..... those moments of feeling unmotivated to code will go away once someone starts paying you to do it :) Just think of all those times in school when you're using your brain so much you just get tired and un motivated.... well programming uses your brain quite alot. you're going to get exhausted and unmotivated darn near everytime. It might not be noticable all the time but that's just what happens when you make your brain work hard.

 

Now back to my hole to code some more..... P.S. take breaks, its common place to have 10 minute internet breaks every hour to get your sanity (motivation) back.




#5033982 Putting pieces inside a board

Posted by freeworld on 18 February 2013 - 08:10 PM

The board class is a grid itself. What does the grid class look like. Does it have operator to allow access to the data like a normal array? Or functions to do so.

I would keep the falli g piece seperate from the board untill its done falling. Then copy the contents of your pieces to the correct spot on the board.


#5033580 Putting pieces inside a board

Posted by freeworld on 17 February 2013 - 07:01 PM

obviously homework.... The questionsuggests you already have a function that pretty much does what it is you're supposed to do, you just have to make the changes you're told to make and write a new function to to just that.

 

 You don't see the the board array? it's the first chunk of code you posted.

 

if this really is homework, ask your instructor these same exact questions, that's what you're paying him for.




#5025519 Struggling to change render order of lists of objects (XNA)

Posted by freeworld on 25 January 2013 - 01:20 PM

Would not just be easier to assign all your objects a z or depth value. This can simply be the distance between the object and your camera or car. Then just sort list based on the depth so that farthest away are drawn first. Then all you have to do is call the render function instead of having to iterate through your list for every object.

Ive only played with xna a little. I think my suggestion will require you to keep every object in one list. Hope that helps a little. I can go in more depth when im home.


Also your question why the zombie is always on top. Im going to take a stab in the dark and say your zombie sprite is taller than your debris sprite. And since youre useing the y value as your comparison the zo.bie wins everytime being taller in all.


#4992809 How much CPU usage should just an empty game loop have

Posted by freeworld on 22 October 2012 - 10:45 AM

Depends on the platform. If the target is plugged into the wall then it should be eating up 99-100% im sure any reason you have for limiting it is mislead and very possibly dumb.

Now if this is on a platform that has battery life. Never mind still your main loop doesnt matter. Your app is gonna run when its on. Its what you do in that loop that matters.

Now stop with the silly questions and code something.


#4963052 Preventing Chaos in your game code

Posted by freeworld on 25 July 2012 - 02:04 PM

This from my phone so excuse the horrible grammer/spelling.

For now i wouldnt worry about the chaos (spaghetti code) sounds like you just need a little more experience. So just keep on coding. Thats how youll get that experience.

Imho the biggest killer of projects is the same mentality that youre getting into. That everything has to be perfect feom the get go. Take a great example... diablo 3. Blizzard sold billions in the first day and the game is still plagued with bugs two months after release.

Not saying its alright to make buggy games. But that productivity is very important. You should focus on finisging the game first and for most. Assuming you have some worth finishing. Then refactor once youre in the optomizing phase of your prohect.

So get back to coding. Play your game often while developing. And worry about fixing things when something is actually broken.



#4912832 How do you make your art?

Posted by freeworld on 13 February 2012 - 07:59 PM

Adobe Photoshop, Illustrator, 3DS Max, & Maya


You seriously dropped that much cash and dont make your own art?

On a serious note... it's called drawing, modeling, painting... it's called making art. Just google drawing tutorials or 3d modeling tutorials.


#4912792 Ping Pong (Ball Movement)

Posted by freeworld on 13 February 2012 - 05:52 PM

how bout doing this each frame...

ballPosition += ballVelocity * frameTime;

// ballPosition is the position the ball is
// ballVelocity is how fast the ball is moving
// frametime is the amount of time that passed since last frame

I prefer using vectors, which are basically just x, y and z coordinates, to represent my positions and velocities. You could use single variables aswell...

ballX += velocityX * frameTimer;
ballY += velocityY * frameTimer;

Think about how you implemented the paddle movement, just this time instead of waiting for player input, it moves automatically.


#4901318 SDL vs SFML

Posted by freeworld on 10 January 2012 - 09:32 AM


sdla is depricated unsupported and doeant support hardware exceleration... Teaching yourself to use outdated software will more than likely just teach you bad habits.

SDL is not deprecated, nor unsupported. SDL supports certain classes of hardware acceleration - though these are becoming more and more irrelevant, and are no longer defaults. However, it does allow you to get an OpenGL context very easily, and from there you have all the hardware acceleration you could want. SDL is far more portable than SFML. SDL is also much maturer than SFML. SFML is a C++ API, whereas SDL has bindings to most popular languages.

There are plenty of legitimate reasons to continue using SDL. It will not teach you bad habits.


I was under the impressions it hasnt been update in quite some time and no longer supported by those that made it. I didnt say he was gauranteed to learn bad habits.


#4901141 SDL vs SFML

Posted by freeworld on 09 January 2012 - 06:27 PM

1: your title is extremely miss leading... i was expecting a flame war but found complaining.

2: sdla is depricated unsupported and doeant support hardware exceleration.

3: im sure its annoying to not get the responses you wanted... but interacting with the world tends to be that way. Try googling your pro lem if. Also im sure its been iterated in ypur posts what i said in number two. Teaching yourself to use outdated software will more than likely just teach you bad habits.


#4894735 Critique My Sprites

Posted by freeworld on 17 December 2011 - 04:32 AM

First of all... Yaio, seriously, that's the name you choose?

This is my opinion, or atleast what they look like to me. Also the flatness doesn't bother me too much, looks like old school nes graphics.

You're walk animation looks like he's just pleasuring himself.

You're jump animation looks like he's dancing

You're hurt animation looks like more dancing, or is he fist pumping.

You're die animation looks like he's growing a ginger mustache, and punching the ground out of anger for growing a mustache.

You're cast animation looks like he's trying to hand over something, and the eye changing just looks weird.

Your area cast looks like he's pondering, about the fact his eye is still bugging out.

The self cast looks like he's regrowing his arms.

Why are the eyes bugging out in all the animations?


#4893658 Writing a game engine

Posted by freeworld on 13 December 2011 - 04:46 PM

A GameEngine is a bunch of code/methods what enables you to write a nice game.
The GameEngine is nothing more then methods / algorithms / templates which makes it easier to write a game.

I'm handling all input events in the GameEngine so I can call methods like 'IsLeftButtonPressed()'.
In the GameEngine I got all drawings methods so I don't need to write HPEN hOldPen and stuff. Just 'DrawLine(..)


a lot like how a game is a bunch of code/methods that lets you play a nice game? What you describe (quite vaguely) sound like a SDK/API/Framework. An engine is far greater than that. An engine should abstract everything but game logic, and no DrawLine is not game logic, that's rendering code. By abstracting I mean you should never have to write any of that in your code. You should only have to write the code for your game, if that, alot just let you plug in objects using a wysiwyg interface. You're putting together a framework, even though you already have one available to you?

Do you know what game you're making this framework for?

I don't mean to be rude, but it irks me when someone claims to know so much but then asks for help on some of the most basic concepts, then turns out to be too stubborn to take advice.

If you haven't yet, read up on YAGNI and KISS, no not the musicians.




PARTNERS