Welcome, Guest. Please login or register.
December 21, 2014, 01:59:18 AM

Login with username, password and session length
Search:     Advanced search
Congratulations to Andrew Barker! RPGfan Editor of the Year and now Chief News Editor!
341130 Posts in 13942 Topics by 2222 Members
Latest Member: XanTehMan
* Home Help Search Login Register
+  RPGFan Message Boards
|-+  Media
| |-+  Single-Player RPGs
| | |-+  I made a game: Rescue at Grisly Gulch
« previous next »
Pages: 1 [2] Print
Author Topic: I made a game: Rescue at Grisly Gulch  (Read 4853 times)
MeshGearFox
Posts: 8758


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #15 on: September 01, 2009, 05:42:54 PM »

Syntax is actually really similar, except FreeBASIC doesn't REQUIRE suffixes on variable names and you can't do implicit declaration.

I was under the impression that QBasic didn't support user-defined types or pointers as robustly as FreeBASIC does.

---edit---

FreeBASIC still doesn't seem to support dynamic memory allocation, I think, which makes doing projectiles slightly trickier. Although it SHOULD have dynamically sized arrays? I think it's just a matter of ReDim'ing them. I don't think doing this constantly counts as good programming practice.

I guess I COULD do something like allocate more memory in groups of maybe eight spaces in an array and then deallocate it as necessary, although I'm not sure I can get the size of an array via function or built in command, and I'm not sure storing the size somewhere as either a global or static variable counts as good practice (the former being sloppy, the latter being sort of an awkward kludge).

It's also not really necessary given the scope of the program but declaring a 1024 entry array of projectile objects is just stupid.

Or I could take the easy way out and just make everything hitscan~~~~~~
« Last Edit: September 02, 2009, 03:18:32 AM by MeshGearFox » Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #16 on: September 03, 2009, 10:55:47 PM »

Why would you need 1024 projectiles at once, if you hard coded it?

ReDimming is fine in my opinion, because that puts the strain on the processor rather than taking up X amount of RAM by default.  This isn't a processor intensive program, so you have plenty of room.  As long as you can pass a variable as the size of the array, you can make a function that creates an array of size "NumberOfProjectiles + 1", loops through to populate the new array, and then deletes the old array.  I think you already figured that out though.

Sorry, I know you're dealing with language limitations, and I'm just providing general, imperfect solutions.
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8758


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #17 on: September 04, 2009, 01:16:08 AM »

Quote
Why would you need 1024 projectiles at once, if you hard coded it?

Because I'm retarded and I don't like dynamically allocating stuff manually :(

Quote
As long as you can pass a variable as the size of the array

I was thinking of having something like a memory manager for the projectiles that would:

ReDim the array (Freebasic let's you redim while leaving data intact)

Store the current array size in a static variable (Okay, statics are bad. Whatever).

Set the last element in the array to some sort of terminating object so that I don't need to keep passing the size back and forth because that drives me nuts.

I dunno I need to actually work on this this weekend. I also need to come up with some sort of structure for the projectiles. Right now I'm just trying to get it to draw an indefinite amount of 0's and then move them in the proper direction.

(And various assorted issues with handling gamestates and gameloops~)

---edit---

Okay so more importantly I need to majorly refactor how movement works, how player data is stored and passed around, and come up with a menu system since shooting depends on that. Additionally, uh, I just need to remember that right now the projectile creation functions just place a thing on the map and it moves.
« Last Edit: September 05, 2009, 02:03:13 AM by MeshGearFox » Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Fei
Posts: 1336


!?

Member
*


View Profile

Ignore
« Reply #18 on: September 05, 2009, 03:51:36 PM »

We should make a journal thread for all of this programming stuff.  Additionally, I'd love to hear what kind of struggles the RPGMaker people have to deal with... I talk a lot of crap about RPGMaker, but I really haven't seen what they're doing.
Logged

If you re-spec your elduhz and own a Vita - http://twitter.com/BSNursery
MeshGearFox
Posts: 8758


HERE ON RUM ISLAND WE DO NOT BELIEVE IN RUM!

Member
*


View Profile

Ignore
« Reply #19 on: September 05, 2009, 10:35:59 PM »

I tried to do that at one point in time. I'll give you the initiative this time because all of my threads always suck :(
Logged

o/` I do not feel joy o/`
o/` I do not dream o/`
o/` I only stare at the door and smoke o/`

Pages: 1 [2] Print 
« previous next »
Jump to:  



Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!