|
|
|
eigenbom
|
 |
« Reply #2476 on: March 02, 2012, 11:57:08 PM » |
|
How many devices do you own!?!
|
|
|
|
|
Logged
|
|
|
|
|
PompiPompi
|
 |
« Reply #2477 on: March 03, 2012, 06:22:48 AM » |
|
Gah, doing "for (int x = -nx/x; ... )" in C++ has interesting results. O.O Of course when you debug it you catch it immediately because x is 0 in debug("random" in C++) and you get a divide by zero exepction. I should be more proffessional and do more extensive tests before releasing versions.  I also believe that there should be a warnning against these kind of things, but since I completely ignore warnnings(too lazy to clean them up) then I am shooting myself in the leg with a shot gun. heh...
|
|
|
|
|
Logged
|
 Kickstarter? no no no... it's Kicksucker...
|
|
|
|
nospoon
|
 |
« Reply #2478 on: March 03, 2012, 10:12:08 AM » |
|
try { drawFrame(); }catch(Exception e) { //do nothing } This is how i handle exceptions.
|
|
|
|
|
Logged
|
|
|
|
|
Xienen
|
 |
« Reply #2479 on: March 04, 2012, 07:57:34 AM » |
|
Wait, we're supposed to handle exceptions? I always just watch the game come crashing down. I'm doing it wrong! Writing in pure C probably isn't helping me do it right, eh? 
|
|
|
|
|
Logged
|
Owner/Programmer at Greater Good Games makers of Break Blocks Currently developing It Hungers(Unity) and Swipe Attack(UDK)
|
|
|
|
Nix
|
 |
« Reply #2480 on: March 04, 2012, 11:09:46 AM » |
|
It's up to you, really. If the exception going off doesn't affect anything, then you can just "handle" it with an empty block. If the exception would be fatal anyway, then not handling them and letting the application crash might be fine, assuming you have a good debugger (handling the exception and then closing the application yourself gives you an opportunity to make a pretty error message). Often you can use exceptions as a regular part of program flow. For example, if opening the graphics settings file fails, then you probably need to make a new one and ask the user for the desired default settings.
|
|
|
|
|
Logged
|
|
|
|
|
Absurdist
|
 |
« Reply #2481 on: March 04, 2012, 03:23:00 PM » |
|
Yeah, I'd say that the most common use of exceptions is when networking or dealing with files... the kind of situations when you can't control the environment.
|
|
|
|
|
Logged
|
|
|
|
|
Will Vale
|
 |
« Reply #2482 on: March 04, 2012, 05:41:40 PM » |
|
I don't think any amount of explaining exception handling is going to make it work in C...
|
|
|
|
|
Logged
|
|
|
|
|
Ashkin
|
 |
« Reply #2483 on: March 04, 2012, 06:35:44 PM » |
|
Modifying flixel, no matter how trivial the modifications are, makes me feel powerful. 
|
|
|
|
|
Logged
|
|
|
|
|
Overkill
|
 |
« Reply #2484 on: March 05, 2012, 12:16:05 AM » |
|
Implemented a cheesy function pointer event system that switches cartridge ROM banks and then indirect calls to a 16-bit address. This means the code no longer has to fit into the first two 4K banks of MBC5, and I can better segment subsystems of this RPG. ; Indirect call to the address stored in hl. indirect_call: ; Arguments: ; hl = destination address jp [hl]
; Switch active MBC rom bank. SWITCH_ROM_BANK: MACRO ; Dirty: a, [active_rom_bank] ld a, \1 ld [active_rom_bank], a ld [mbc_rom_bank], a ; Write-only hardware register. ENDM
; Call a subroutine in another bank, and restore the old bank afterward. CALL_FAR: MACRO ; Dirty: all registers, [active_rom_bank]. ; Arguments: ; \1 = bank ; \2 = destination address to `call`. ; Switch to destination bank. ld a, \1 ld [mbc_rom_bank], a ; Call the subrotuine. call \2 ; Restore "active" bank, whatever it was. ld a, [active_rom_bank] ld [mbc_rom_bank], a ENDM
; Call an event in a far segment of code, ; Defined by an event pointer formed by the macro args ; \1 .. \3, that contains a lo, hi, and bank address part. ; If [\1] == [\2] == 0, nothing is called. CALL_EVENT: MACRO ; Dirty: all registers. ; Arguments: ; \1 = low ; \2 = high ; \3 = bank ld a, [\1] ld l, a ld a, [\2] ld h, a or a, l ; A = H | L. jr z, .null_call_\@ ; if H | L != 0, then the stat event is set. Call! ; Save the current active bank. ld a, [active_rom_bank] ld b, a push bc ; Change the active bank. SWITCH_ROM_BANK [\3] ; Call the thing. CALL_FAR [\3], indirect_call ; Restore the old active bank. pop bc SWITCH_ROM_BANK b .null_call_\@: ENDM
|
|
|
|
|
Logged
|
|
|
|
|
st33d
Guest
|
 |
« Reply #2485 on: March 05, 2012, 02:51:29 AM » |
|
Just blind-debugged an AS2 graphics app  Only took a day...
|
|
|
|
|
Logged
|
|
|
|
|
EdgeOfProphecy
|
 |
« Reply #2486 on: March 05, 2012, 03:01:32 AM » |
|
The system I designed for items in my game worked on the first shot.
I was so afraid to run it that I spent a day working on animating the items as they appear on the game board, do some flips, fly into your inventory, active, etc.
When I actually got around to activating an item I was like, "Oh hey...it worked!"
It's pretty cool 'cause you can design the items by attaching sets of persistent buff effects or instant effects, and just chain together as many as you want of whatever magnitude, all without touching a bit of code. Want to make an item that slows down time, lowers the character's stamina by 25, gives you 500 points and lets you deal 2 more damage for 5 seconds? No problem!
|
|
|
|
|
Logged
|
|
|
|
|
Aloshi
|
 |
« Reply #2487 on: March 05, 2012, 04:42:58 AM » |
|
It's not game related, but I just got my java Xfire client receiving IMs after four days of work! (I've got a group of friends who only use Xfire and am unhappy with the Android Xfire client...so I decided to try making my own. It probably won't end up being any better, but it's a fun project and an excellent learning experience)
|
|
|
|
|
Logged
|
|
|
|
|
kamac
|
 |
« Reply #2488 on: March 05, 2012, 07:24:17 AM » |
|
Mwhahahah. From because I had nothing better to do, I started doing some island generation, which then I could create isometric/RPG maps from! A screenie of few generated maps: (LEGEND - normal green, grass dark green, tree bright green, random plant dark color, a building gray, bricks ground yellow, beach) Two randomly generated islands. I can now have lots of these   I'll have to add forests generation too.
|
|
|
|
|
Logged
|
|
|
|
|
Revk
|
 |
« Reply #2489 on: March 05, 2012, 11:33:24 AM » |
|
...
This is quite nice, I love it. Do you have some open-source code for it?
|
|
|
|
|
Logged
|
|
|
|
|