Help with playing game

Previous topic - Next topic

Falcon

Im new to GLBasic, just downloaded the demo, alls going well, using the sample game. But I discovered one problem: everytime I try to alcually play my game, a box appears, a large and kinda blurry demo at the top-left of the screen slides out, and it says beneath it that the music stopped. Also, next to the DEMO is a thing that looks like a play symbol, except I cant click on it. I dont have any music in the game, and I know in demo version music wont work, but why wont my game?? Thank you!!!!

Kitty Hello

uhm... The Demo thingy that slides out is just a watermark to remind you what you are playing with ;). It's nothing to klick. The box that is below *new* *new* *new* is an indicator when your 2 minutes demo-time is up. What's wrong with the game - and which one is it? Post some code if it's yours.

Falcon

Ok. Its the sample game-basicly I drew some of my own pictures, but other than that im copying everything the movie says to do, so I can understand it a little bit. After the DEMO slides out, its just that screen until I close it, it wont load my alcual game. Heres all I have in the code box-
Code (glbasic) Select
// --------------------------------- //
// Project: Myfirstgame
// Start: Monday, March 27, 2006
// IDE Version: 3.069


// DEMO-VERSION:
// Missing features:
// 3D Graphics
// MP3 Playback
// Network Commands
// Full 16 Joystick-Button Support
// No Watermark in Executables

LOADBMP "background.bmp"
LOADSPRITE "walk1.bmp", 0
LOADSPRITE "walk2.bmp", 1
LOADSPRITE "spider.bmp", 2

WHILE TRUE
    // animation:
    delta=delta+1
    IF delta>10
       ani=1-ani
       delta=0
    ENDIF
    SPRITE 0, 320, 300

    // spider
    spider_x = spider_x - 1
    SPRITE 2, spider_x, 400
    SHOWSCREEN
WEND
Thanks for the help :)

Kitty Hello

OK. You write spider_x = spider_x -1. When you start, the spider_x variable has a value of 0 - you didn't assign it anywhere. Now, within 30-60 SHOWSCREENS (that's about 1/2 - 1 second) the sprite is far off the left border, (which has x-coordinate '0'.
If you add "spider_x = 640" at the very beginning of your program enlighment will sourround you :D
So, had little sleep last night, have to get some now ;)

Falcon

It still wont work. I did what you said, and heres what I have after going on a little bit-
Code (glbasic) Select
// --------------------------------- //
// Project: Myfirstgame
// Start: Monday, March 27, 2006
// IDE Version: 3.069



LOADBMP "background.bmp"
LOADSPRITE "walk1.bmp", 0
LOADSPRITE "walk2.bmp", 1
LOADSPRITE "spider.bmp", 2

spider_x = 480

WHILE TRUE
    // animation:
    delta=delta+1
    IF delta>10
       ani=1-ani
       delta=0
    ENDIF
    SPRITE 0, 320, 400 - SIN(jump_pos) * 100
    // jumping
    IF KEY(57) AND jumping=FALSE
     jumping = TRUE
     jump_pos = 0
    ENDIF
    IF jumping
        jump_pos = jump_pos +1
        IF  jump_pos>180
          jump_pos = 0
          jumping=FALSE
      ENDIF
  ENDIF

    // spider
    spider_x = spider_x - 1
    ROTOSPRITE 2, spider_x, 400, spider_x*3
   
   
   
    SHOWSCREEN
WEND
As you can see I did three things-changed what you said, (And when it still didnt work, tried some other things). Removed what it said the demo didnt have, because it was getting annoying, and added the jumping. It still wont work though, all I get when I hit Start game f5 is a black screen, a blurry demo scroling a little bit and stopping, and a Demo:Music stopped. Thank you for helping. One more thing-I made a movie of what happens when I click play game, but cant figure out how to get it on here. Thanks again!!!

Kitty Hello

OK. Black screen?

Make sure the "background.bmp" exists in the project's folder (where the mygame.exe is created). Also the other graphics.

After the line:
SPRITE 0, 320, 400 - SIN(jump_pos) * 100
add:
FILLRECT 320,400,360,420,RGB(255,255,255)
to see if only the sprite didn't get loaded

After the ROTOSPRITE add:
IF spider_x < -60 THEN spider_x = 800
to make the spider come again from right side after it left the left side.

Did you see, that you can download the demo-game as a complete project with graphics and so on, too?

PS. Perform an internet-update (Menu: web/internet-update) to get the latest version.

Falcon

Alright, Thank you very much. I never thought that having the pictures in different folders mattered, Thanks again. (Of course, now that I can alcually play it, I see tons of other problems, but Il figure those out as I go :)