https://github.com/Zexxerd/Simple-Platformer

The problem can be found in "Issues", but I'll put it here too.

At lines 127-154 of the main program (127-134 commented out), for some reason, a bunch of syntax errors occur that don't seem to have any solid reason for occurring. I don't know what other lines this affects. Here's a sample:


Code:

Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (139,16) :   ERROR (100) Syntax error
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (139,25) :   WARNING (221) Type defaults to int
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (139,26) :   ERROR (128) Identifier "value" not defined within current scope
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (139,26) :   ERROR (182) Static objects may be initialized with constant expressions only
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (140,10) :   ERROR (100) Syntax error
First off all, it makes zero sense why those typedef'd structures are in the main function. That's just bad programming.

Anyway, the issue is you can't compare strings with ==. You need to use the strcmp() function.

Also I don't know how many times I told you this, but never ever ever use 16 bit types unless you want your program to be slow and big.
MateoConLechuga wrote:
First off all, it makes zero sense why those typedef'd structures are in the main function. That's just bad programming.

I moved them into the function for some reason. I forgot why.
MateoConLechuga wrote:
Also I don't know how many times I told you this, but never ever ever use 16 bit types unless you want your program to be slow and big.

What types am I supposed to use?
SomeCoolGuy wrote:
What types am I supposed to use?

int or unsigned int?
Any idea what's happening here?

Code:

Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (135,54) :   ERROR (100) Syntax error
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (136,33) :   ERROR (193) Missing "52" detected
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (136,33) :   ERROR (100) Syntax error
Z:\USERS\~\...\PLATFORMER\SRC\MAIN.C   (136,33) :   WARNING (221) Type defaults to int
Quote:
20:44 <saxjax> [MateoConLechuga] SomeCoolGuy: The other issue is you are putting a function inside another function??
20:45 <saxjax> [SomeCoolGuy] That was me being lazy.

You literally acknowledge that you did it, and yet fail to fix it???
MateoConLechuga wrote:
Quote:
20:44 <saxjax> [MateoConLechuga] SomeCoolGuy: The other issue is you are putting a function inside another function??
20:45 <saxjax> [SomeCoolGuy] That was me being lazy.

You literally acknowledge that you did it, and yet fail to fix it???

That's it. I'm gonna do the practical thing by putting all those struct definitions in a header file. Not sure if that'll fix anything but it'll make the code more organized.
Why isn't the struct variable declaration working at line 249?
You can't have a variable declaration after code. Move that line one line up, above the call to sprintf.
I've cleaned up most of the bugs. The only things left are these "(171) Argument type is not compatible with formal parameter" errors. Take the one at line 245, column 72, for example. I don't understand what's happening here, or which function argument for levelCollisionOffset is causing the error. I'm thinking that the second argument (the level) is causing the error since changing the third argument did nothing to change the result.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement