Bitcoin Forum
May 12, 2024, 05:57:03 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: The Internet has been very stale lately.  (Read 1837 times)
FirstAscent
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1000


View Profile
August 28, 2013, 07:45:18 PM
 #21

Quote from: Remember remember the 5th of November
Those are just semantics, I write clean code, if you see how the MyBB team code it's just gorgeous.
[/quote

No, I haven't seen. Are you claiming your code is gorgeous?

Quote
Plus

if(eval)
{
    // code
}

is much better than

if(eval) {
    // code
}

It's much better? One of the reasons for putting the opening curly on the same line is to show a little more code per page, decreasing scrolling for comprehension. Note that I'm not using the word 'better'. I'm stating a reason for a preference.

Whitespace is good, and necessary, but not in this case.
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715536623
Hero Member
*
Offline Offline

Posts: 1715536623

View Profile Personal Message (Offline)

Ignore
1715536623
Reply with quote  #2

1715536623
Report to moderator
1715536623
Hero Member
*
Offline Offline

Posts: 1715536623

View Profile Personal Message (Offline)

Ignore
1715536623
Reply with quote  #2

1715536623
Report to moderator
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
August 28, 2013, 07:59:09 PM
 #22

Stop with this useless code.

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
miffman
Legendary
*
Offline Offline

Activity: 1904
Merit: 1005


PGP ID: 78B7B84D


View Profile
August 28, 2013, 09:28:53 PM
 #23

If you think the Internet is stale, you haven't been to leekspin.com recently  Grin














 

 

█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
BitBlender 

 













 















 












 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
█ 
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
August 28, 2013, 09:42:14 PM
 #24

If you think the Internet is stale, you haven't been to leekspin.com recently  Grin
Ty! I forgot about this site i find it funny, time to bookmark and hypnotise myself!  Cheesy
http://leekspin.com/
For link purposes.

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
MysteryMiner
Legendary
*
Offline Offline

Activity: 1470
Merit: 1029


Show middle finger to system and then destroy it!


View Profile
August 28, 2013, 11:41:32 PM
 #25

Old school!


Now that's a real smoothie! New avatar anyone?
 

bc1q59y5jp2rrwgxuekc8kjk6s8k2es73uawprre4j
Foxpup
Legendary
*
Offline Offline

Activity: 4354
Merit: 3044


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
August 29, 2013, 01:14:50 AM
 #26

Collision is simple, assuming that your characters are rectangles here is a sample of my old code
Collision detection is simple (for simple shapes, anyway); it's collision response that's the hard part. Wink

For platform games, this depends on the type of objects that collided.

The simplest case is, of course, a bullet. A colliding bullet simply disappears and causes damage to whatever it collided with.

Enemy vs. player collisions are more complicated, since unless the player is a one hit-point wonder, both objects will still be around and still be intersecting unless you do something about it. Depending on the game, you may or may not want enemies to be solid (see below), and in either case, if the collision itself causes damage (as opposed to the more realistic case of requiring one actor to actually perform an attack in order to damage the other), then you need knockback and/or mercy invincibility to avoid repeating the damage on every frame.

Finally comes the platforms themselves (as well as anything else that functions as a solid platform). Here, it's important to know which direction the collision came from (whether you walked into a wall, bumped your head on the ceiling, or are standing on the floor). For square actors, this can be accomplished by checking which axis (X or Y) has the greatest absolute difference between the distance and the sum of the sizes of the actors (ie, how deeply they're interpenetrating) (for rectangular actors, you also need to take into account the actors' aspect ratio). The sign of the difference tells you the direction. Then it's just a simple matter for zeroing the moving actor's velocity in that axis, and clipping its position to the plane of the platform. For the special case of collisions from above (standing on the floor), you also want to set a flag saying that the actor is standing on a floor, so you can set appropriate animation, etc.

Note that all of the above only applies if no object can move fast enough to reach the other side of another within a single frame (mostly a problem for bullets, but can affect falling players if they have no terminal velocity). In that case, it gets even more complicated.

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
Phinnaeus Gage
Legendary
*
Offline Offline

Activity: 1918
Merit: 1570


Bitcoin: An Idea Worth Spending


View Profile WWW
August 29, 2013, 06:42:49 AM
 #27

Wait till the song B.DOUBLE O.T.Y comes out in both a rap and country version at the same time.
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!