Hmm okay thanks, ill have to think about how im going to get this working.
Type: Posts; User: hwing91
Hmm okay thanks, ill have to think about how im going to get this working.
Oh yeah sorry, I used that code.
The delete_position() works fine, I had an error in something else that I fixed.
So draw_ball() isn't suppose to draw 3 balls? It seems like its drawing the...
So now that i've fixed the collision detection to register for multiple balls, right off the bat if I draw two balls everything works fine.
If I draw one, then have a condition that add_position()'s...
AHHHHHHHHHHHHHHH, I see. Thank you SO much again. I think im done with my code, all I have to do is tweak my collision detection and implement adding/removing balls and im done.
So i've been working on it a bit and I've decided to have a linked list with the data of the position of the balls, and a draw_ball function that cycles through the linked list and draws all the...
We program C in netbeans and we use VBA to perform tasks. I'm making a game, with my premade drawRect and drawCircle functions that work correctly.
I plan on having balls (at the head of the node)...
Ah I see so
positions->next->next->col //would access my last(third) right?
I guess I could write a function to make it easier if I had alot more nodes. Thanks again!!
Not random access, accessing certain nodes, for example, the second node I stored.
Okay thanks. Is it possible to access certain nodes with this method without looping through all of them as you did? Or would I have to write a more complex linked list function?
void...
Hmm I have a few questions again. I'll comment them in the code you helped me with.
Would this function be correct in deleting the first node in that linked list?
void add_position(Position**...
No yeah, I plan on adding multiple balls and removing them depending on circumstances, I can see the usefulness already, its just the syntax that's confusing more so.
My project proposal is to...
Okay thanks!
So this is my definition so far.
typedef struct _position{
int row;
int col;
struct _position *next;
}Position;
Position* positions =...
Would this be correct in declaring a singly-linked list then, if i only wanted these three?
typedef struct _position{
int row;
int col;
struct _position *next;
...
Hm okay...I'm still confused on the syntax on how to define a linked list and access nodes from them.
So if I wanted to begin to change my storage into a linked list method, would something like...
Yeah whoops, thanks alot for your help so far lol, my professor really doesn't do anything to aid us in our class.
So I just read a quick article about them.
So, bare with me since I really do...
Hmm maybe my understanding of dynamic memory isn't as good as I thought, in class thats how we were always taught to create a structure and store elements into it.
That is the code im using to...
Hello! I am taking a beginning C class at my school and the requirements for this homework is to make a game using linked lists.
The requirements with linked lists are
- To draw elements of linked...