Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: 1 ... 9 10 [11]   Go Down

Author Topic: Programming Q&A  (Read 31389 times)

0 Members and 1 Guest are viewing this topic.

Xiphirx

wat
Re: Programming Q&A
« Reply #200 on: April 17, 2009, 11:48:55 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Sorry for double posting, but it seems like no one else is using this topic :P

Is there any motion path system in Blitzmax? Anyone know how I can implement it?
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #201 on: April 17, 2009, 11:55:34 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
No there isn't a built in one. Its something that would normally built on a the higher-level game engine, its not something that would be built into a language. Its not exactly hard to do though, try writing your own.
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #202 on: April 18, 2009, 12:27:11 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
No there isn't a built in one. Its something that would normally built on a the higher-level game engine, its not something that would be built into a language. Its not exactly hard to do though, try writing your own.

Do you know of any ones already made? I am using this for the competition and I don't exactly have the time.
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #203 on: April 18, 2009, 12:54:29 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
No. As I said, the system is not exactly hard to build, nor that time consuming. I doubt anyone has made a module specifically for it.
Logged

Xiphirx

wat
Re: Programming Q&A
« Reply #204 on: April 18, 2009, 01:19:26 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
No. As I said, the system is not exactly hard to build, nor that time consuming. I doubt anyone has made a module specifically for it.

*starts to think about algorithms*
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #205 on: April 18, 2009, 05:36:29 am »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
Regarding hitboxes in C++, what would be the fastest way to check if the player is colliding with one of them?  Say, there's 20 hitboxes, basically how could I quickly check if the player is colliding with one of them?  The hitboxes are instances of a class called CHitBox and a collision is detected through a function that returns true or false based on where the two hitboxes being checked are located in relation to one another.
Logged



i love big weenies and i cannot lie
Re: Programming Q&A
« Reply #206 on: April 18, 2009, 12:34:06 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
Regarding hitboxes in C++, what would be the fastest way to check if the player is colliding with one of them?  Say, there's 20 hitboxes, basically how could I quickly check if the player is colliding with one of them?  The hitboxes are instances of a class called CHitBox and a collision is detected through a function that returns true or false based on where the two hitboxes being checked are located in relation to one another.
There are all kinds of intresting ways to deal with collision detection, it really depends on the effort you want to put in and how badly you want to optimize it. You could do the simple route of just iterating through all objects and testing the players hitbox against the objects hitbox, and returning a collision if any exist. Or if you want you could build up a quadtree or a similar data structure and limit all collision detection to hit boxes within the leaf of the tree that the player is in. Its really up to you. For the majority of the time though, simply interating through a list will be more than fine, especially when you only have 10 or so.
Logged
Re: Programming Q&A
« Reply #207 on: April 18, 2009, 03:23:41 pm »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
Well, 10 was only an example, I expect to have a lot more than that.  But, considering how my collision algorithm works, I don't think it will take too much time to iterate through a list.  Thanks, I'll see what I can do.
Logged



i love big weenies and i cannot lie

Xiphirx

wat
Re: Programming Q&A
« Reply #208 on: May 12, 2009, 03:33:14 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
Is there something I should know about the SendMessage API function and VB 2005? It doesn't want to work for me at all :|

Declaration:
Code: [Select]
Declare Function SendMessage Lib "USER32" Alias "SendMessageA" ( _
        ByVal hWnd As Long, ByVal Msg As Long, _
    ByVal wParam As Integer, ByVal lParam As String) As Long

Usage:
Code: [Select]
Call SendMessage(hWndTextbox, WM_SETTEXT, 0, "--- XMX MOD ---")


The odd thing is that the code worked perfectly in VB 6 :|
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #209 on: May 12, 2009, 05:44:07 am »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
What's the error that you're getting?  I don't think you need that call command in there..
Logged



i love big weenies and i cannot lie

Xiphirx

wat
Re: Programming Q&A
« Reply #210 on: May 12, 2009, 03:53:12 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
What's the error that you're getting?  I don't think you need that call command in there..

-- Fixed
« Last Edit: May 15, 2009, 12:47:42 am by Xiphirx »
Logged
  • For The Swarm
Re: Programming Q&A
« Reply #211 on: May 24, 2009, 04:43:27 am »
  • Doesn't afraid of anything
  • *
  • Reputation: +42/-0
  • Offline Offline
  • Gender: Male
  • Posts: 7002
How can I read the data from a comma delimited file with C++?  I've got a VB program that outputs data like this to a file, for example:

-1, -1, 0, 5, 6, 4, 3, 3, 3, 3, 3 , 1, 25, 30, 99, 80, 5, "Player", 10, 12

(just made some numbers up..)

How could I read these into a C++ program?  I'm not really too familiar with file I/O in this language.

Logged



i love big weenies and i cannot lie
Re: Programming Q&A
« Reply #212 on: May 24, 2009, 09:04:24 am »
  • (y)(;>.<;)(y)
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3293
well you could go through it byte by byte appending to a string as you go until you hit the end of file or a comma,
then convert the string to an integer value...
Logged
Pages: 1 ... 9 10 [11]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.229 seconds with 59 queries.

anything