Results 1 to 6 of 6

Thread: Problems with level loading...

Threaded View

  1. #1

    Thread Starter
    Frenzied Member CyberCarsten's Avatar
    Join Date
    Sep 1999
    Location
    Aalborg Ø, Denmark
    Posts
    1,544

    Problems with level loading...

    Hi!
    I am programming a breakout game, but cant seem to get the leve loading working....

    loading code:
    Code:
    int LoadLevel(int level){
    	char File ="level.dat";
    	char s[32];
    
    	Num = fscanf(File, " %s %d %d ",  &level_x, &level_y);
    	if(Num != 2){
        return false;
    }
    return(1) ;
    }
    File format
    Code:
    <x_coord> <y_coord>
    Level file:
    Code:
    1 10
    5 20
    10 30
    15 40
    20 45
    25 50
    30 55
    35 60
    40 65
    45 70
    50 75
    55 80
    60 90
    65 100
    70 110
    75 120
    80 130
    85 140
    90 150
    95 160
    100 170
    105 180
    110 190
    115 200
    120 210
    I get the following errors:
    :\Game Programming Projects\CrazyBalls 2\main.cpp(212) : error C2440: 'initializing' : cannot convert from 'char [10]' to 'char'
    This conversion requires a reinterpret_cast, a C-style cast or function-style cast
    F:\Game Programming Projects\CrazyBalls 2\main.cpp(215) : error C2664: 'fscanf' : cannot convert parameter 1 from 'char' to 'struct _iobuf *'
    Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
    F:\Game Programming Projects\CrazyBalls 2\main.cpp(534) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
    F:\Game Programming Projects\CrazyBalls 2\main.cpp(537) : warning C4244: '=' : conversion from 'const double' to 'int', possible loss of data
    Error executing cl.exe.

    CrazyBalls 2.exe - 2 error(s), 5 warning(s)


    Hope you can help me correct my errors....
    Last edited by CyberCarsten; Jan 7th, 2003 at 06:30 AM.
    razor
    Software Engineer Student, Aalborg University, Denmark
    http://www.cs.auc.dk

    My email at AUC: will get a new email soon
    My website: http://www.razorsoftware.net


    Windows XP Pro/ Gentoo Linux (Laptop)
    Windows XP Pro (Home PC)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width