t3hlazy1 / game

Awesome Java Game
1 stars 0 forks source link

Read a File into a Linked List #4

Open t3hlazy1 opened 11 years ago

t3hlazy1 commented 11 years ago

We need a function to read in an input file into a linked list. File will look like: object 100 100 2000 50 object2 100 100 1500 25 ...

and function needs to read each field into a node in C it's something like: fscanf(in, "%s %d %d %d %d", currentNode->name, currentNode->posX, currentNode->posY, currentNode->health, currentNode->speed); well you would prob read them into local vars, then call a function with all the vars fscanf(in, "%s %d %d %d %d", name, posX, posY, health, speed); newNode = addNode(head, name, posX, posY, health, speed);

but, this is something we need to get working.

meescah commented 11 years ago

I agree, and I'll try to help as much as possible.. but I'm terrible at Linked Lists, but maybe I can try to give ideas or something, and about the Tiled thing, I'll start learning that as soon as possible