BASIC

Author Topic: Shoot Em Up - Video  (Read 24875 times)

Offline Shogun

  • Mr. Drawsprite
  • **
  • Posts: 67
    • View Profile
Shoot Em Up - Video
« Reply #30 on: 2007-Oct-02 »
wie dumm, na klar, die Grafiken. Garnicht drann gedacht.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4971
  • O Rly?
    • View Profile
Shoot Em Up - Video
« Reply #31 on: 2007-Oct-02 »
Aller anfang ist schwer Shogun ist kein Beinbruch, passiert uns allen mal so leichtsinnsfehler, Jaaaaaa auch den lieben Herrn Gernot ;)
I <3 DGArray's :D

PC:
AMD RYzen 7 1700 @3.9Ghz, 16GB HyperX Fury 2666Mhz Ram, ASUS ROG GTX 1060 STRIX 6GB, Windows 10 Pro 64Bit, MSi Tomahawk B350 Mainboard

Offline Antidote

  • Mr. Polyvector
  • ***
  • Posts: 164
    • View Profile
    • http://antidotes.wordpress.com
Shoot Em Up - Video
« Reply #32 on: 2007-Oct-02 »
ohne Bilder wird es schwer... ;)
PC Core2Duo e4300, 2GBRam, Geforce 8800GT-1gb, XPsp3
GP2x, Wii, XBox360, Wiz, psp, ps3 usw.

Offline Hotshot

  • Mc. Print
  • *
  • Posts: 22
    • View Profile
Re: Shoot Em Up - Video
« Reply #33 on: 2012-Aug-15 »
Very good Tutorials :nw:

Offline bigsofty

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 2537
    • View Profile
Re: Shoot Em Up - Video
« Reply #34 on: 2012-Aug-16 »
Just be aware that the language has changes a lot in the 5 years since these videos were created.  ;)
Cheers,

Ian.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration.”
(E. W. Dijkstra)

Offline aroldo

  • Mr. Polyvector
  • ***
  • Posts: 143
    • View Profile
    • APD Consulting, Inc.
Re: Shoot Em Up - Video
« Reply #35 on: 2012-Oct-20 »
Hello GLB community!

I decided to do some improvements in this great tutorial made by Gernot (Kitty Hello), so I did changes to it as follows:
  • Added Sound
  • Images

The Blaster GLB project,  image and sound files are attached in the zip file below.
Just unzip to the directory of your choice.

Enjoy!!!

Here is the code.
Code: GLBasic [Select]
// --------------------------------- //
// Project: Blaster
// Start: Thursday, April 05, 2007
// IDE Version: 4.145

// A SHOT type. It's just the position in this sample
// Ein Schuss-TYPE. Hier ist nur die Position von Bedeutung
TYPE SHOT
        x
        y
ENDTYPE

TYPE FOE
        x
        y=10
        speed=3
        amour=4
ENDTYPE

TYPE BOOM
        x
        y
        time
ENDTYPE
// Variables

// a SHOT for adding new ones later
// ein SHOT um später neue hinzuzufügen
LOCAL newshot AS SHOT
LOCAL newbug  AS FOE
LOCAL player_x, player_y

// Image Sizes
LOCAL player_w, player_h
LOCAL lazer_w, lazer_h
LOCAL shot_w, shot_h
LOCAL bug_w, bug_h
LOCAL boom_w, boom_h


LOCAL delay
LOCAL time, nextbug, didhit

LOCAL screenW, screenH
// Audio
GLOBAL vol = 1.0 // 0.0 low - 1.0 loud
GLOBAL pan = 0 // -1.0 left, 0 center, 1.0 right

// The SHOTs array. Here the shots get inserted
// das SHOTs Feld. Hier kommen die Schüsse rein
LOCAL shots[] AS SHOT
LOCAL bugs[] AS FOE
LOCAL poof[] AS BOOM

//Sound Files
LOADSOUND "Media/sounds/blow.wav", 0, 4                         // shot
LOADSOUND "Media/sounds/explosion.wav", 1, 2            // explosion

// Images
LOADSPRITE "Media/images/lazer.png", 0
LOADSPRITE "Media/images/shot.png", 1
LOADSPRITE "Media/images/bug.png",  2
LOADSPRITE "Media/images/boom.png", 3

GETSPRITESIZE 0, lazer_w, lazer_h               // lazer
GETSPRITESIZE 1, shot_w, shot_h                 // shot
GETSPRITESIZE 2, bug_w, bug_h                   // bug
GETSPRITESIZE 3, boom_w, boom_h                 // boom


GETSCREENSIZE screenW, screenH

// Set player X and Y position on the screen
player_x = screenW/2
player_y = screenH/3

WHILE TRUE
        // Player Movement
        // Spieler Bewegung
        INC player_x, MOUSEAXIS(0)
        // Limit to borders
        // Auf den Rand begrenzen
        player_x=MAX(MIN(player_x,screenW),0)