10.03.2019 - Round 1 results of our "A Love Letter For FreeBASIC" game dev competition have been published. Please be sure to check the results thread: http://games.freebasic.net/forum/index.php?topic=629.0. Don't forget that the competition is continuing with a round 2, lasting till 29th of April, 300 USD first prize. Stay tuned!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ChangeV

Pages: [1]
1
it sounds like FMOD related routine is causing the crash on some system.
BGM loading routine uses dynamically allocated list.
I changed it to simple array. it should fix the crash.

http://www.mediafire.com/file/7ly34hi9u0isf5g/LoveLetter_v1.1.zip/file

2
Here is my entry.
The Love letter to FreeBASIC (chan!)


http://www.mediafire.com/file/dm9587is2o65ho4/LoveLetter_v1.0.zip/file

ChangeV wrote a love letter to FreeBASIC chan.
but there are love-crazy enemies everywhere.
They will try to approach FreeBASIC chan with various things like love letter, heart, or even the money.

beat them all and win the heart of FreeBASIC chan.
but, beware... some enemies are immune to weapons.
ChangeV needs to find a different way to beat them.
When enemies are beaten to death, they will stay on screen and confuse the player.
as more enemies pile up on screen, the battlefield will become crazy mayham.
stay sharp and good luck.

how to play:
Cursor key to move.
Z key to throw the axe.
X key to jump.

Joypad is supported but only tested with XB360-wired and PS-mini classic joypad.
default setting is for xb360 joypad.
so If you want to use joypad, be sure to go to option meanu and remap the button.

I tested game on Win10 64bit gaming PC and old winXP laptop with 700MHz cpu.(both 32 bit compile)
I couldn't use SBsound... I had no free time to test/learn it.
so I just reused old FMOD sound code and seems works ok on both win10 and xp.

3
I've been too busy lately, I haven't touched project for 3 weeks.
here is basic idea concept and sample program which tests the colored-switch idea.

Code: [Select]
#IFNDEF TRUE
CONST FALSE = 0
CONST TRUE = NOT FALSE
#ENDIF

#INCLUDE ONCE "fbgfx.bi"
USING fb

ENUM blahblah
result_nothing = 0
result_stage_cleared
result_user_quit
result_game_over
result_ok
END ENUM

TYPE enemy_type
   x          AS INTEGER
   y          AS INTEGER
   respawn_x  AS INTEGER
   respawn_y  AS INTEGER
   direction  AS INTEGER
   speed      AS INTEGER
   move_range AS INTEGER
   base_color AS INTEGER
END TYPE

TYPE player_type
   is_dead    AS INTEGER
   x          AS INTEGER
   y          AS INTEGER
   dx         AS INTEGER
   dy         AS INTEGER
   respawn_x  AS INTEGER
   respawn_y  AS INTEGER
END TYPE

CONST AS INTEGER white1 =  15, white2     = 248
CONST AS INTEGER blue   = 249, light_blue = 250
CONST AS INTEGER red    = 251, light_red  = 252

DIM AS INTEGER game_result

DIM SHARED AS STRING * 20 mapdata(0 TO 29) => {_
"11111111111111111111",_
"15000011111311111111",_
"10111033333333330001",_
"10111011111111110701",_
"10000011111111110001",_
"11111222111111111111",_
"11111110000000000001",_
"11111110111111110001",_
"11111110111111110401",_
"11111110111111110001",_
"11111110111111110001",_
"11100000000011111111",_
"11106000000011111111",_
"11100000000011111111",_
"11111111111111111111",_ '
_
"11111111111111111111",_
"10000011111111111111",_
"10000011111111111111",_
"10600000004088881111",_
"10000011111111181111",_
"11111111111111181111",_
"10000111111111181111",_
"10000111111111101111",_
"10700000111115001111",_
"10000110111111101111",_
"10000110111111101111",_
"11111110111111101111",_
"11119999999999999991",_
"11111111111111111111",_
"11111111111111111111"}

DIM SHARED AS INTEGER map(20, 15)
DIM SHARED AS INTEGER switch(10)
DIM SHARED AS INTEGER player_is_dead


DIM SHARED AS player_type player
DIM SHARED AS enemy_type enemy(10)

DECLARE SUB PRINT_ (s AS STRING)
DECLARE SUB DELAY  (BYVAL n AS DOUBLE)
DECLARE SUB CLEANUP DESTRUCTOR

DECLARE SUB INITIALIZE_COLOR ()
DECLARE SUB INITIALIZE_MAP   (BYVAL stage AS INTEGER = 1)
DECLARE SUB INITIALIZE_ENEMY (BYVAL stage AS INTEGER = 1)
DECLARE SUB INITIALIZE_PLAYER(BYVAL stage AS INTEGER = 1)

DECLARE SUB PROCESS_ENEMY  (BYVAL stage AS INTEGER = 1)
DECLARE SUB PROCESS_PLAYER (BYVAL stage AS INTEGER = 1)
DECLARE SUB PROCESS_SWITCH (BYVAL stage AS INTEGER = 1)
DECLARE FUNCTION CHECK_FOR_GOAL (BYVAL stage AS INTEGER = 1) AS INTEGER

DECLARE SUB DRAW_MAP (BYVAL stage AS INTEGER = 1)

DECLARE SUB DRAW_PLAYER (BYVAL x AS INTEGER, BYVAL y AS INTEGER, color_base AS INTEGER = 31)
DECLARE SUB DRAW_ENEMY  (BYVAL x AS INTEGER, BYVAL y AS INTEGER, BYVAL c AS INTEGER = white2)

'map grid checking.
DECLARE FUNCTION CHECK_FOR_SOLID_CELL (BYVAL  i AS INTEGER, BYVAL  j AS INTEGER) AS INTEGER
DECLARE FUNCTION CHECK_RECTANGLE      (BYVAL xx AS INTEGER, BYVAL yy AS INTEGER) AS INTEGER

DECLARE SUB title( BYREF result AS INTEGER)
DECLARE SUB stage_clear_message()
DECLARE SUB GAME_OVER_MESSAGE()
DECLARE SUB TO_BE_CONTINUED_MESSAGE()
DECLARE SUB PLAY_STAGE (BYVAL stage AS INTEGER, BYREF result AS INTEGER)


SUB PRINT_ (s AS STRING)
   DIM AS INTEGER DEBUG = FREEFILE
   OPEN CONS FOR OUTPUT AS #debug 'debug message log
   ? #debug, s
   CLOSE #debug
END SUB

SUB DELAY(n AS DOUBLE)
   DIM AS DOUBLE old_timer = TIMER
   DO
      SLEEP 1, 1
   LOOP UNTIL (old_timer + n) <= TIMER
END SUB

SUB CLEANUP DESTRUCTOR
   'this will reduce some typing. I'm lazy.
   #DEFINE remove(blahblah) IF ( blahblah ) <> 0 THEN IMAGEDESTROY( blahblah )

   'PRINT "-Clean up. freeing some images"
   'remove ( some_tile )
END SUB

SUB INITIALIZE_COLOR()
   'change unused palette 248-255 into some colors
   PALETTE white2     , 255, 255, 255
   PALETTE blue       ,   0,   0, 255
   PALETTE light_blue ,   0,   0,  96
   PALETTE red        , 255,   0,   0
   PALETTE light_red  ,  96,   0,   0
END SUB

SUB INITIALIZE_MAP(BYVAL stage AS INTEGER = 1)
   'initialize map
   FOR j AS INTEGER =0 TO 14
      FOR i AS INTEGER =0 TO 19
         SELECT CASE AS CONST stage

            CASE 1 'load stage 1 data into map
               map(i, j) = VAL(MID(mapdata(j), i + 1, 1))

            CASE 2 'load stage 2 data into map
               map(i, j) = VAL(MID(mapdata(j + 15), i + 1, 1))
         END SELECT
      NEXT
   NEXT
   FOR i AS INTEGER = 0 TO 9
      switch(i) = FALSE
   NEXT

END SUB

SUB INITIALIZE_ENEMY(BYVAL stage AS INTEGER = 1)
   SELECT CASE AS CONST stage
      CASE 1
         'initialize enemy
         enemy(0).x = 32*11+15
         enemy(0).y = 32*2+15
         enemy(0).respawn_x = enemy(0).x
         enemy(0).respawn_y = enemy(0).y

         enemy(0).direction = 1
         enemy(0).speed = 1
         enemy(0).move_range = 64
         enemy(0).base_color = white2

      CASE 2
         enemy(0).x = 32*15+15
         enemy(0).y = 32*3+15
         enemy(0).respawn_x = enemy(0).x
         enemy(0).respawn_y = enemy(0).y
         enemy(0).direction = 4
         enemy(0).speed = 1
         enemy(0).move_range = 64+32
         enemy(0).base_color = red

         enemy(1).x = 32*8+15
         enemy(1).y = 32*12+15
         enemy(1).respawn_x = enemy(1).x
         enemy(1).respawn_y = enemy(1).y
         enemy(1).direction = 1
         enemy(1).speed = 1
         enemy(1).move_range = 64+32+32
         enemy(1).base_color = red

         enemy(2).x = 32*10+15
         enemy(2).y = 32*12+15
         enemy(2).respawn_x = enemy(2).x
         enemy(2).respawn_y = enemy(2).y
         enemy(2).direction = 1
         enemy(2).speed = 1
         enemy(2).move_range = 64+32+32
         enemy(2).base_color = blue

         enemy(3).x = 32*12+15
         enemy(3).y = 32*12+15
         enemy(3).respawn_x = enemy(3).x
         enemy(3).respawn_y = enemy(3).y
         enemy(3).direction = 1
         enemy(3).speed = 1
         enemy(3).move_range = 64+32+32
         enemy(3).base_color = blue

         enemy(4).x = 32*14+15
         enemy(4).y = 32*12+15
         enemy(4).respawn_x = enemy(4).x
         enemy(4).respawn_y = enemy(4).y
         enemy(4).direction = 1
         enemy(4).speed = 1
         enemy(4).move_range = 64+32+32
         enemy(4).base_color = red

   END SELECT

END SUB

SUB INITIALIZE_PLAYER(BYVAL stage AS INTEGER = 1)

   SELECT CASE AS CONST stage
      CASE 1 'initialize player for stage 1
         player.x = 32*4+15
         player.y = 32*12+15
      CASE 2 'initialize player for stage 2
         player.x = 32*2+15
         player.y = 32*3+15
   END SELECT
   player.dx = 0
   player.dy = 0

   player.is_dead = FALSE

END SUB

SUB PROCESS_SWITCH(BYVAL stage AS INTEGER = 1)
   'check if player hits switch

   SELECT CASE AS CONST stage

      CASE 1 'stage 1 switch processing
         'firse switch
         IF SQR(( (17*32+16)-(player.x) )^2 + ((8*32+16)-(player.y))^2) <= 20 THEN
            switch(0) = TRUE
         END IF
         'second switch
         IF SQR(( (1*32+16)-(player.x) )^2 + ((1*32+16)-(player.y))^2) <= 20 THEN
            switch(0) = FALSE
         END IF
      CASE 2 'stage 2 switch processing
         'red switch
         IF SQR(( (10*32+16)-(player.x) )^2 + ((3*32+16)-(player.y))^2) <= 20 THEN
            switch(0) = TRUE
         END IF
         'blue switch
         IF SQR(( (13*32+16)-(player.x) )^2 + ((8*32+16)-(player.y))^2) <= 20 THEN
            switch(1) = TRUE
         END IF

   END SELECT
END SUB

SUB PROCESS_ENEMY(BYVAL stage AS INTEGER = 1)

   #DEFINE radius 10

   '--- enemy section ------------

   SELECT CASE AS CONST stage
      CASE 1 'stage 1 enemy stuff (hard coded)

         'check if enemy moved too far from origin, flip its direction
         IF ABS(enemy(0).respawn_x - enemy(0).x) > enemy(0).move_range  THEN
            enemy(0).direction *= -1
         END IF
         'move enemy
         enemy(0).x += enemy(0).speed * enemy(0).direction

         '--------------------hit detection needed
         IF POINT(enemy(0).x+7, enemy(0).y) <> 15 THEN
            IF (player.x >= enemy(0).x-13) AND (player.x<= enemy(0).x+13) AND _
            (player.y >= enemy(0).y-12-radius) AND (player.y <= enemy(0).y+13+radius) THEN player.is_dead or= TRUE

            IF (player.x >=  enemy(0).x-13-radius) AND (player.x<= enemy(0).x+13+radius ) AND _
            (player.y >= enemy(0).y-12) AND (player.y <= enemy(0).y+13 ) THEN player.is_dead or= TRUE

            player.is_dead or=  SQR((( enemy(0).x-13)-player.x )^2 + (((enemy(0).y-12) - player.y))^2) <= radius
            player.is_dead or=  SQR((( enemy(0).x+13)-player.x )^2 + (((enemy(0).y-12) - player.y))^2) <= radius
            player.is_dead or=  SQR((( enemy(0).x-13)-player.x )^2 + (((enemy(0).y+13) - player.y))^2) <= radius
            player.is_dead or=  SQR((( enemy(0).x+13)-player.x )^2 + (((enemy(0).y+13) - player.y))^2) <= radius
         END IF

      CASE 2

         IF (enemy(0).direction=4) AND (ABS(enemy(0).respawn_x - enemy(0).x) > enemy(0).move_range) THEN enemy(0).direction = 2
         IF (enemy(0).direction=2) AND (enemy(0).respawn_x = enemy(0).x-1) THEN enemy(0).direction = 3
         IF (enemy(0).direction=3) AND (ABS(enemy(0).respawn_y - enemy(0).y) > enemy(0).move_range) THEN enemy(0).direction = 1
         IF (enemy(0).direction=1) AND (enemy(0).respawn_y = enemy(0).y) THEN enemy(0).direction = 4

         SELECT CASE AS CONST enemy(0).direction
            CASE 1 : enemy(0).y -= enemy(0).speed
            CASE 2 : enemy(0).x += enemy(0).speed
            CASE 3 : enemy(0).y += enemy(0).speed
            CASE 4 : enemy(0).x -= enemy(0).speed
         END SELECT

         FOR i AS INTEGER = 1 TO 4
            'check if enemy moved too far from origin, flip its direction

            IF ABS(enemy(i).respawn_x - enemy(i).x) > enemy(i).move_range  THEN
               enemy(i).direction *= -1
            END IF
            'move enemy
            enemy(i).x += enemy(i).speed * enemy(i).direction
         NEXT

         'let's check hit detection for all enemies here
         'if any of them touches player, dead flag will be set.
         FOR i AS INTEGER = 0 TO 4

            'enemy hidden under the colored panel can't touch player.
            'use point to pick up panel color and compare with enemy color.
            IF POINT(enemy(i).x+7, enemy(i).y) <> enemy(i).base_color THEN

               IF (player.x >= enemy(i).x-13) AND (player.x<= enemy(i).x+13) AND _
               (player.y >= enemy(i).y-12-radius) AND (player.y <= enemy(i).y+13+radius) THEN player.is_dead or= TRUE

               IF (player.x >=  enemy(i).x-13-radius) AND (player.x<= enemy(i).x+13+radius ) AND _
               (player.y >= enemy(i).y-12) AND (player.y <= enemy(i).y+13 ) THEN player.is_dead or= TRUE

               player.is_dead or=  SQR((( enemy(i).x-13)-player.x )^2 + (((enemy(i).y-12) - player.y))^2) <= radius
               player.is_dead or=  SQR((( enemy(i).x+13)-player.x )^2 + (((enemy(i).y-12) - player.y))^2) <= radius
               player.is_dead or=  SQR((( enemy(i).x-13)-player.x )^2 + (((enemy(i).y+13) - player.y))^2) <= radius
               player.is_dead or=  SQR((( enemy(i).x+13)-player.x )^2 + (((enemy(i).y+13) - player.y))^2) <= radius
            END IF
         NEXT
   END SELECT
END SUB

SUB PROCESS_PLAYER(BYVAL stage AS INTEGER = 1)

   'check if player tries to go into walls using too big dx, dy
   'adjust dx or dy until player stands right next to wall

   IF player.dy > 0 AND CHECK_RECTANGLE(player.x, player.y + player.dy) THEN
      DO
         player.dy -= 1
      LOOP UNTIL CHECK_RECTANGLE(player.x, player.y + player.dy) = FALSE OR player.dy < -1000
   END IF

   IF player.dy < 0 AND CHECK_RECTANGLE(player.x, player.y + player.dy) THEN
      DO
         player.dy += 1
      LOOP UNTIL CHECK_RECTANGLE(player.x, player.y + player.dy) = FALSE OR player.dy > 1000
   END IF

   IF player.dx > 0 AND CHECK_RECTANGLE(player.x + player.dx, player.y) THEN
      DO
         player.dx -= 1
      LOOP UNTIL CHECK_RECTANGLE(player.x+ player.dx, player.y ) = FALSE OR player.dx < -1000
   END IF

   IF player.dx < 0 AND CHECK_RECTANGLE(player.x+ player.dx, player.y ) THEN
      DO
         player.dx += 1
      LOOP UNTIL CHECK_RECTANGLE(player.x+ player.dx, player.y ) = FALSE OR player.dx > 1000
   END IF

   'dx, dy seems ok. use them to update player's position
   player.x += player.dx
   player.dx = 0

   player.y += player.dy
   player.dy = 0
END SUB

FUNCTION CHECK_FOR_GOAL (BYVAL stage AS INTEGER = 1) AS INTEGER
   'exit area position is hardcoded
   SELECT CASE AS CONST stage
      CASE 1
         IF SQR(( (17*32+16)-(player.x) )^2 + ((3*32+16)-(player.y))^2) <= 20 THEN
            RETURN TRUE
         END IF

      CASE 2
         IF SQR(( (2*32+16)-(player.x) )^2 + ((8*32+16)-(player.y))^2) <= 20 THEN
            RETURN TRUE
         END IF

   END SELECT
   RETURN FALSE

END function

SUB DRAW_MAP(BYVAL stage AS INTEGER = 1)
   LINE(0,0)-(639,479), 0,bf

   FOR j AS INTEGER =0 TO 14
      FOR i AS INTEGER =0 TO 19

         SELECT CASE map(i, j)
            CASE 0 'empty road

               LINE(i*32,j*32)-(i*32+31, j*32+31),0,bf
            CASE 1 'solid wall

               LINE(i*32,j*32)-(i*32+31, j*32+31),15,bf

            CASE 2 'wall block 1 (depending on switch state)
               IF switch(0) THEN
                  LINE(i*32,j*32)-(i*32+31, j*32+31),0,bf
               ELSE
                  LINE(i*32,j*32)-(i*32+31, j*32+31),15,bf
               END IF

            CASE 3 'wall block 1
               IF switch(0) THEN
                  LINE(i*32,j*32)-(i*32+31, j*32+31),15,bf
               ELSE
                  LINE(i*32,j*32)-(i*32+31, j*32+31),0,bf
               END IF

            CASE 4 'switch 1
               SELECT CASE AS CONST stage
                  CASE 1 'stage 1 switch
                     CIRCLE(i*32+16,j*32+16),10 ,(white1)
                     IF switch(0) THEN CIRCLE(i*32+16,j*32+16),8 ,(white1),,,,f
                  CASE 2 'stage 2 red switch
                     CIRCLE(i*32+16,j*32+16),10 ,(red)
                     IF switch(0) THEN CIRCLE(i*32+16,j*32+16),8 ,(red),,,,f
               END SELECT

            CASE 5 'switch 2
               SELECT CASE AS CONST stage
                  CASE 1 'stage 1 switch2
                     CIRCLE(i*32+16,j*32+16),10 , (white1)
                     IF NOT(switch(0)) THEN CIRCLE(i*32+16,j*32+16),8 ,(white1),,,,f
                  CASE 2 'stage 2 blue switch
                     CIRCLE(i*32+16,j*32+16),10 , (blue)
                     IF switch(1) THEN CIRCLE(i*32+16,j*32+16),8 ,(blue),,,,f
               END SELECT

            CASE 6 'start
               PSET(i*32+16,j*32+16)
               DRAW "c15ne10nf10ng10nh10"

            CASE 7 'goal
               CIRCLE(i*32+16,j*32+16+5),3 ,(15),,,.6
               CIRCLE STEP(0,0),7 ,(15),,,.6
               LINE -STEP(0,-20),(15)
               DRAW "c 15 M+10,+5M-10,+5bm+5,-5p 15, 15"

            CASE 8 'red panel
               IF switch(0) THEN
                  LINE(i*32,j*32)-(i*32+31, j*32+31),red,bf
               ELSE
                  LINE(i*32,j*32)-(i*32+31, j*32+31),light_red,bf
               END IF

            CASE 9 'blue panel
               IF switch(1) THEN
                  LINE(i*32,j*32)-(i*32+31, j*32+31),blue,bf
               ELSE
                  LINE(i*32,j*32)-(i*32+31, j*32+31),light_blue,bf
               END IF
         END SELECT
      NEXT
   NEXT
END SUB

SUB DRAW_PLAYER(BYVAL x AS INTEGER, y AS INTEGER, color_base AS INTEGER = 31)
   CIRCLE(x  , y), 10, color_base
   CIRCLE(x-3, y),  4, color_base, , , 1.5
   CIRCLE(x+4, y),  4, color_base, , , 1.5
   PAINT (x, y+3), color_base, color_base
END SUB

SUB DRAW_ENEMY(BYVAL x AS INTEGER, BYVAL y AS INTEGER, BYVAL c AS INTEGER = white2)
   LINE (x - 13, y - 12)-(x + 13, y + 13), c, b
   PSET (x -  3, y +  7), c
   DRAW "c" & c & "h7u5f7d5"
   PSET (x +  3, y +  7), c
   DRAW "c" & c & "e7u5g7d5"
   PAINT (x, y), c, c
END SUB

SUB DRAW_ENEMIES(BYVAL stage AS INTEGER = 1)
   SELECT CASE AS CONST stage
      CASE 1
         DRAW_ENEMY(enemy(0).x, enemy(0).y, enemy(0).base_color)
      CASE 2
         DRAW_ENEMY(enemy(0).x, enemy(0).y, enemy(0).base_color)
         DRAW_ENEMY(enemy(1).x, enemy(1).y, enemy(1).base_color)
         DRAW_ENEMY(enemy(2).x, enemy(2).y, enemy(2).base_color)
         DRAW_ENEMY(enemy(3).x, enemy(3).y, enemy(3).base_color)
         DRAW_ENEMY(enemy(4).x, enemy(4).y, enemy(4).base_color)

   END SELECT
END SUB

FUNCTION CHECK_FOR_SOLID_CELL(i AS INTEGER, j AS INTEGER) AS INTEGER
   'if try to access out of array range, return true
   IF (i >= 0) AND (i <= 19) AND (j >= 0) AND (j <= 14) THEN

      ' condition for detectint wall needed
      SELECT CASE map(i, j)
         CASE 0,4,5,6,7,8,9 'empty, start, end, switchs, colored walls
            RETURN FALSE
         CASE 1 'normal wall
            RETURN TRUE
         CASE 2 'special wall
            IF switch(0) THEN RETURN FALSE ELSE RETURN TRUE
         CASE 3 'special wall
            IF switch(0) THEN RETURN TRUE ELSE RETURN FALSE
         CASE ELSE 'every other walls just in case
            RETURN TRUE
      END SELECT

   ELSE
      RETURN TRUE 'out of map grid range(20,15)
   END IF
END FUNCTION

FUNCTION CHECK_RECTANGLE(xx AS INTEGER, yy AS INTEGER) AS INTEGER
   DIM AS INTEGER gxl, gxr, gyu, gyd

   'check solid or not with on_the_map position
   gxl = (xx - 10) \ 32
   gxr = (xx + 10) \ 32
   gyu = (yy - 10) \ 32
   gyd = (yy + 10) \ 32
   DIM mul AS INTEGER
   DIM mur AS INTEGER
   DIM mdl AS INTEGER
   DIM mdr AS INTEGER

   mul = CHECK_FOR_SOLID_CELL(gxl, gyu)
   mur = CHECK_FOR_SOLID_CELL(gxr, gyu)
   mdl = CHECK_FOR_SOLID_CELL(gxl, gyd)
   mdr = CHECK_FOR_SOLID_CELL(gxr, gyd)

   RETURN (mul OR mur OR mdl OR mdr)
END FUNCTION

SUB title( BYREF result AS INTEGER)

   DIM k AS string

   CLS

   LOCATE 15,27
   PRINT "  temporary title screen  "

   LOCATE 45,27
   PRINT "press [space key] to start"

   DO
      k=INKEY
      SLEEP 1,1

   LOOP until k=" " OR k = CHR(27)

   IF k = " " THEN
      result = result_ok
   ELSE
      result = result_user_quit
   END IF

END SUB

SUB stage_clear_message()

   LOCATE 28, 29: PRINT "                         "
   LOCATE 29, 29: PRINT "                         "
   LOCATE 30, 29: PRINT "  S T A G E   C L E A R  "
   LOCATE 31, 29: PRINT "                         "
   LOCATE 32, 29: PRINT "                         "

   SLEEP 2000,1
   CLS
   SLEEP 500,1

   WHILE LEN(INKEY)
   WEND

END SUB


SUB game_over_message()

   LOCATE 28, 31: PRINT "                     "
   LOCATE 29, 31: PRINT "                     "
   LOCATE 30, 31: PRINT "  G A M E   O V E R  "
   LOCATE 31, 31: PRINT "                     "
   LOCATE 32, 31: PRINT "                     "

   SLEEP 2000,1
   CLS
   SLEEP 500,1

   WHILE LEN(INKEY)
   WEND

END SUB


SUB to_be_continued_message ()
   
   cls
   LOCATE 28, 31: PRINT "                     "
   LOCATE 29, 31: PRINT "                     "
   LOCATE 30, 31: PRINT "   to be continued   "
   LOCATE 31, 31: PRINT "                     "
   LOCATE 32, 31: PRINT "                     "

   SLEEP 3000,1

   WHILE LEN(INKEY)
   WEND

END SUB




SUB PLAY_STAGE(BYVAL stage AS INTEGER, BYREF result AS INTEGER)
   DIM AS INTEGER quit_game = FALSE, player_dead = FALSE, stage_clear = FALSE
   DIM AS STRING k

   result = result_nothing

   IF stage < 3 THEN

      INITIALIZE_MAP(stage)
      INITIALIZE_ENEMY(stage)
      INITIALIZE_PLAYER(stage)

      DO
         k = INKEY
         quit_game = (k = CHR(27))


         'if URDL direction key is pressed, set just dx and dy here.
         IF MULTIKEY(SC_UP)    THEN player.dy = -2
         IF MULTIKEY(SC_DOWN)  THEN player.dy = +2
         IF MULTIKEY(SC_LEFT)  THEN player.dx = -2
         IF MULTIKEY(SC_RIGHT) THEN player.dx = +2

         SCREENLOCK
         DRAW_MAP(stage)
         
         PROCESS_ENEMY(stage)
         PROCESS_PLAYER(stage)
         PROCESS_SWITCH(stage)

         stage_clear = CHECK_FOR_GOAL(stage)

         '--- output section ------------
         DRAW_ENEMIES(stage)


         DRAW_PLAYER(player.x, player.y,31)


         'player.is_dead = FALSE
         SCREENUNLOCK

         'some simple delay
         DELAY .011

         IF MULTIKEY(SC_LSHIFT) THEN DELAY(.5)

      LOOP UNTIL quit_game OR player.is_dead OR stage_clear

      'game loop has ended with various reasons.
      'if reason is stage clear, set the result flag.
      IF stage_clear THEN
         result = result_stage_cleared
         stage_clear_message()
      END IF

      'if player is dead, display game over screen for a few seconds.
      IF player.is_dead THEN GAME_OVER_MESSAGE()

      'if esv key is pressed, return to title screen with quit flag seting
      IF quit_game THEN result = result_user_quit

   ELSE
      'there is no stage 3.
      'display be continued message or something.

      TO_BE_CONTINUED_MESSAGE()

      result = result_game_over 'treat as gameover and go back to title screen

   END IF


END SUB


'--- main ---

RANDOMIZE TIMER

SCREENRES 640, 480, 8,, GFX_HIGH_PRIORITY
SETMOUSE ,,0

INITIALIZE_COLOR() 'make some unused color into white, red, blue.. etc.

DO

   TITLE(game_result)

   IF game_result = result_ok THEN

      'repeat stage-1 until stage-clear or quit
      DO
         PLAY_STAGE(1, game_result)
      LOOP UNTIL game_result = result_user_quit OR game_result = result_stage_cleared

      'go to next stage on stage-1-clear
      IF game_result = result_stage_cleared THEN

         'repeat stage-2 until stage-clear or quit
         DO
            PLAY_STAGE(2, game_result)
         LOOP UNTIL game_result = result_user_quit OR game_result = result_stage_cleared

         'display "to be continued" mesage on stage-2-clear
         IF game_result = result_stage_cleared THEN
            PLAY_STAGE (3, game_result)
         END IF

      END IF

   END IF

LOOP UNTIL game_result = result_user_quit



it's simple stage based maze game where player avoids enemy and get to the goal.


black and white only in the beginning.
get color gem to unlock color switchs.
each color switch will light up some area. and enemy with same color will be invisible (can pass through)

certain area will be affected by more than 1 switch.
combined color will be need to pass certain enemies(red, orange, yellow, green, blue, purple, and some weird color for all 3 color switches)

at first, stage will be 1 screen.
later, bigger stage will be scrolled. (and maybe add minimap.)

additional idea
maybe, later stage will require color key to open the door.
even more colors using 32bit-color wheel.

paint bucket: player changes color and sneak into background.
pulsating/color changing area, focus on timing to pass enemy.

other hazards idea :
conveyor belt
pushable block
switch with timer
warp panel
saw follows the wall
various traps on floor
ice floor(sliding until hit wall)
traps that shoot projectiles
one way door

4
Competitions / Re: Gameplay Compo Competition Results!
« on: January 29, 2011, 09:31:37 AM »
I am still adding enemies, traps and first boss for platformer part.

I work on game at least 1 hour (just before zzz) every day, but it will take a while to complete.

5
Competitions / Re: Gameplay Compo Competition Results!
« on: January 26, 2011, 05:34:53 PM »
congratulations.
good work everyone.

6
Here is playable demo of platformer part.


http://www.changevworld.com/jawsvsoft/efx/changev_quest(demo).zip

control is simple.

move = Left or Right arrow keys
jump = space key or Z key
exit to title screen = esc key
(you can skip the first part of intro with esc key)


there are no enemies or bosses in the demo.
demo will end when ChangeV gives item to JawsV.
save point is disabled in the demo.
warp point #2, #3 is not available.
ChangeV will die if he stays too long under the water.
by the way, JawsV is my twin brother who makes graphics for our games.
he appears in our game always wearing blue shark suit.

still no progress on top-view game yet.

this is rough plan of whole thing.

sideview part:
ChangeV will explore level.
find boss room.
kill boss and get item.
give item to JawsV.

topview part
JawsV will explore his level with item received from ChangeV.
find boss room.
kill boss to get item.
give item to ChangeV.

it will give ChangeV new ability. he will be able to explore deeper part of level.

they will take turn and explore their area more...
each item will give new ability.
keep repeating until getting the final item.
with that item and their combined power, they will escape from cave.

so far, all 3 ChangeV items/abilities are programmed in.(disabled in demo)

Winter holiday break is over(back to full-time work starting on Jan/3)
Now I have like 1 hour of free time for programming on weekdays.
it is impossible to finish it on time.

since second game part is still in planning stage, the game is incomplete.
I think I will withdraw from compo and finish the game on my own pace.
I will try to make more playable demo before deadline.

7
story
After slime has escaped from castle zoo in Slime Quest, this is what happened to ChangeV.
ChangeV goes to zoo for investigation.
and fell down into well.
the game begins.

This is early screen shot.

background tiles are not final. they are just placeholders.

I am working on some kind of savepoint now.
since I made map editor(finished fixing it today), we will start working on real map.

still no progress at all on top-view part.

8
We are working on some sideview platformer(like metroid) + some topview stuff(like legend of zelda).
It is my first time making a platformer, so I am wasting time by trial and error stuff and testing.
No progress on topview stuff yet.

We don't know if we can finish it on time because I have so little free time(especially when compared with last year)
Also, whole family caught bad flu. and it slows the progress even more.

If we make some progress, we will post screen shot.

9
I found something in Bowser's story while ago...

Bowser not bouncing when he stomps on 2 toads.

When bowser stomps on 2 toads, he will not bounce up. He just lands.
If he stomps on 1 or 3 toads(odd number) he will bounce up.

I think flipping Y velocity is the cause of problem.
When stomping on one of 2 toads, he will bounce up(flipping Y velocity).
And at the same time, he stomps remaining toad and bounce downward(flipping Y velocity again). killing 2 toads in an instant.
I think that is happening in the game.

I think something like this may solve problem.
Code: [Select]
velocity = -(abs(velocity))It will force velocity to negative value on even and odd stomping.

10
I worked halfday and returned home to post/upload my entry.

anyway, because of deadline, lots of idea were dropped.
(town people would level up when they kill slime....something like that)
arena mode(endless fight) was droped.

SLIME QUEST



since I can't upload to ChangeVWorld domain for some reason, I used free file hosting sites.
at least, one of them will work.
http://www.megaupload.com/?d=L0YZQY80
http://rapidshare.com/files/337371810/slime_quest_v03.zip.html
http://www.mediafire.com/download.php?yg1hymrjjl2
http://www.filesend.net/download.php?f=aa76ed8ef160619a8f1190e0d82b65b9

you control slime and try to escape from castle Zoo to your slime village.

find key from people or various objects in town.
and escape before time runs out.
when that happens, ChangeV will get you!

control is super simple.
move with arrow key or joypad
attack with [Space]key or [z]key or [Ctrl]key or joypad button
call menu with [Esc]key or joypad button

tip.
apple will heal some HP.
your slime trail can stun people.(drain some HP too)
knight is immune(iron boots) to slime trail. be careful.
people have recover time when they are punched. so machinegun-punch will not work. time your punch when you attack people.
When you use continue, helper arrow will point where the key is hidden.
slime trail has some effect on fallen people. when you paint a lot on people, some good item will pop up.
You get medal point for doing various task.
joypad is supported.
you can change button setting for menu button and attack button in option menu.

There are many parody from our previous games.
if you played our old QBasic games, you will understand more stuff.

learn well-timed machinegun-punch, it can practically stun people and kill them on the spot

11
Here is old WIP screenshot.



I dropped many features and keep reducing many things as deadline approaches.
I changed Extended play into option menu...(which is not coded yet)

I think I can finish game before deadline.

12
I changed 'lost in forest' theme into 'town exploring' theme.
gameplay is simple NES Zelda style.
it is 2D sprite/tile based. no poligon stuff.
joypad is supported (just 1 button is used)

I just finished title screen this evening.

option is not coded yet.

I am still working on various parts of game.

13
progress: basic game engine is almost done.
I need to add couple more hit detection for some stuff.

14
I am in.

In most of (J)RPGs, heroes kill slimes to level up.
Now, it is your turn being the life of slime, the lowest creature in the RPGs.
Lost in the forest, looking for your slime village...
It is all about the survival in the human world.

15
Work In Progress / hexagon board walking demo.
« on: October 26, 2009, 02:57:27 AM »
I made hexagon-grid based tile engine for remake of certain board game while ago(and forgot about it).
recently I rewrote whole thing again.
it's far from finished, but it's functioning enough to make walking demo.

click anywhere on the map and ChangeV will walk to that tile.
you can toggle unpassable wall with right mouse button.
added non-stop walking NPC.
added ChangeV as controllable character.



download ver.6a (added scrolling camera):
http://www.changevworld.com/jawsvsoft/efx/hex_demo_v6a.zip

credit:
A* path finding routine.
I used info/sample from
http://www.policyalmanac.org/games/aStarTutorial.htm
and coderJeff's example
http://www.freebasic.net/forum/viewtopic.php?t=9952
I removed all pointer access and replaced them with array index and added more stuff and calculation.
It's not optimized, but it is working.

I reused graphics from my old board game.

Pages: [1]