Author Topic: An Idea.(update 1)  (Read 3529 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
An Idea.(update 1)
« on: December 30, 2020, 08:48:50 pm »
Throwing around a Myst or 7thGuest style game idea, but I have no Story idea. working on some of the interface ideas and just wanted to see what people thought of the current look and interaction. There are now 2 objects to interact with in this upload not too hard to find.

Give it a go and let me know if I should continue or what, and any story ideas would be a great help too!
its all mouse interaction, press any key to quit.

Let me know too if you get a half black screen on startup, happens 90% of the time for me and I have to move the window to get it to refresh then all is good.

Code: QB64: [Select]
  1. 'Dark House demo test
  2. 'UniKorn ProDucKions 2020
  3.  
  4. CONST TRUE = -1, FALSE = NOT TRUE
  5.  
  6. DIM SHARED F(5) AS LONG, Mix AS LONG, MouseOver AS LONG, SFX(1) AS LONG, L1 AS LONG
  7. DIM SHARED DoorRT(5) AS LONG, DoorLT(5) AS LONG, DoorRTOpen(5) AS LONG
  8. SCREEN _NEWIMAGE(960, 700, 32)
  9. Mix = _NEWIMAGE(960, 700, 32)
  10. MouseOver = _NEWIMAGE(960, 700, 32)
  11.  
  12. MFI_Loader "DarkHouse.MFI"
  13.  
  14. FOR i%% = 0 TO 5
  15.  _CLEARCOLOR _RGB32(255, 255, 255), F(i%%)
  16.  _CLEARCOLOR _RGB32(255, 255, 255), DoorRT(i%%)
  17.  _CLEARCOLOR _RGB32(255, 255, 255), DoorLT(i%%)
  18.  _CLEARCOLOR _RGB32(255, 255, 255), DoorRTOpen(i%%)
  19. NEXT i%%
  20.  
  21. i%% = 2
  22. _PUTIMAGE (683, 294)-STEP(75, 125), F(0), MouseOver
  23. _PUTIMAGE (815, 304)-STEP(126, 199), DoorRT(0), MouseOver
  24. _PUTIMAGE (23, 304)-STEP(124, 197), DoorLT(0), MouseOver
  25. _SOURCE MouseOver
  26. nul%% = _MOUSEINPUT
  27. _SNDSETPOS SFX(0), 11.8 'echo`y scream
  28. 'scale factors 1.22x by 1.12y
  29.  _PUTIMAGE , L1&, Mix 'load the scene
  30.  
  31.  ' IF MouseTest(_MOUSEX, _MOUSEY) = 64 THEN 'see if the mouse is over the figurine
  32.  SELECT CASE MouseTest(_MOUSEX, _MOUSEY)
  33.   CASE 64 'right side figurine
  34.    j%% = j%% + 1
  35.    IF j%% = 6 THEN i%% = i%% + 1: j%% = 0
  36.    IF i%% = 6 THEN i%% = 2
  37.    _PUTIMAGE (683, 294)-STEP(75, 125), F(i%%), Mix 'play animation
  38.    MouseOverFlag%% = TRUE 'flag the fact that the mouse is over animation
  39.     IF NOT PlaySoundFlag%% THEN _SNDPLAY SFX(0): PlaySoundFlag%% = TRUE
  40.    END IF
  41.   CASE 65 'right side door
  42.    IF NOT OpenDoorFlag%% THEN
  43.     j%% = j%% + 1
  44.     IF j%% = 6 THEN i%% = i%% + 1: j%% = 0
  45.     IF i%% = 6 THEN i%% = 2
  46.     _PUTIMAGE (815, 304)-STEP(126, 199), DoorRT(i%%), Mix 'play animation
  47.     MouseOverFlag%% = TRUE 'flag the fact that the mouse is over animation
  48.    ELSE 'play door opening animation
  49.     j%% = j%% + 1
  50.     IF j%% = 25 THEN i%% = i%% + 1: j%% = 0
  51.     IF i%% = 6 THEN i%% = 2: OpenDoorFlag%% = FALSE
  52.     _PUTIMAGE (815, 304)-STEP(126, 199), DoorRTOpen(i%%), Mix 'play animation
  53.     MouseOverFlag%% = TRUE 'flag the fact that the mouse is over animation
  54.    END IF
  55.    IF _MOUSEBUTTON(1) AND (NOT OpenDoorFlag%%) THEN
  56.     OpenDoorFlag%% = TRUE: j%% = 0: i%% = 1
  57.     IF NOT PlaySoundFlag%% THEN _SNDPLAY SFX(1): PlaySoundFlag%% = TRUE
  58.    END IF
  59.   CASE 66 'left side door
  60.    j%% = j%% + 1
  61.    IF j%% = 6 THEN i%% = i%% + 1: j%% = 0
  62.    IF i%% = 6 THEN i%% = 2
  63.    _PUTIMAGE (0, 306)-STEP(124, 197), DoorLT(i%%), Mix 'play animation
  64.    MouseOverFlag%% = TRUE 'flag the fact that the mouse is over animation
  65.    Mouseovereflag%% = FALSE 'disable flag for mouse over
  66.  END SELECT ' END IF
  67.  
  68.  ' IF MouseOverFlag%% AND _MOUSEBUTTON(1) THEN
  69.  ' IF NOT PlaySoundFlag%% THEN _SNDPLAY SFX(0): PlaySoundFlag%% = TRUE
  70.  ' END IF
  71.  
  72.  IF PlaySoundFlag%% THEN
  73.   IF _SNDGETPOS(SFX(0)) >= 14.9 THEN _SNDSTOP SFX(0): _SNDSETPOS SFX(0), 11.8: PlaySoundFlag%% = FALSE
  74.   IF _SNDGETPOS(SFX(1)) >= 4.4 THEN _SNDSTOP SFX(1): _SNDSETPOS SFX(1), 0: PlaySoundFlag%% = FALSE
  75.  
  76.  _LIMIT 30
  77.  DO: nul%% = _MOUSEINPUT: LOOP WHILE nul%%
  78.  
  79. FUNCTION MouseTest~%% (x%, y%)
  80.  MouseTest = _RED32(POINT(x%, y%))
  81.  
  82. SUB MFI_Loader (FN$)
  83.  DIM Size(128) AS LONG, FOffset(128) AS LONG
  84.  GET #1, , c~%% 'retrieve number of files
  85.  FOR I~%% = 1 TO c~%%
  86.   GET #1, , FOffset(I~%%)
  87.   GET #1, , Size(I~%%)
  88.   FOffset&(I~%%) = FOffset&(I~%%) + 1
  89.  NEXT I~%%
  90.  
  91.  
  92.  L1 = LoadGFX(FOffset(1), Size(1)) '_LOADIMAGE("scenes\haunted_house_by_arty_stock.png", 32)
  93.  FOR i%% = 0 TO 5 'loading figurine
  94.   F(i%%) = LoadGFX(FOffset(2 + i%%), Size(2 + i%%)) '_LOADIMAGE("scenes\animations\Rt_Stair_figure_000.bmp", 32)
  95.  NEXT i%%
  96.  SFX(0) = LoadSFX(FOffset(8), Size(8)) '_SNDOPEN("AudioFX\Human\Female\Screams\Screams.wav")
  97.  FOR i%% = 0 TO 5 'loading Right side Door
  98.   DoorRT(i%%) = LoadGFX(FOffset(9 + i%%), Size(9 + i%%)) '_LOADIMAGE("scenes\animations\Rt_Stair_figure_000.bmp", 32)
  99.  NEXT i%%
  100.  FOR i%% = 0 TO 5 'loading left side Door
  101.   DoorLT(i%%) = LoadGFX(FOffset(15 + i%%), Size(15 + i%%)) '_LOADIMAGE("scenes\animations\Rt_Stair_figure_000.bmp", 32)
  102.  NEXT i%%
  103.  FOR i%% = 1 TO 5 'loading Right side Door opening
  104.   DoorRTOpen(i%%) = LoadGFX(FOffset(20 + i%%), Size(20 + i%%)) '_LOADIMAGE("scenes\animations\Rt_Stair_figure_000.bmp", 32)
  105.  NEXT i%%
  106.  SFX(1) = LoadSFX(FOffset(26), Size(26)) 'door opening creak
  107.  
  108.  CLOSE #1
  109.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  110.  
  111. FUNCTION LoadGFX& (Foff&, Size&)
  112.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  113.  OPEN "temp.dat" FOR BINARY AS #3
  114.  dat$ = SPACE$(Size&)
  115.  GET #1, Foff&, dat$
  116.  PUT #3, , dat$
  117.  CLOSE #3
  118.  LoadGFX& = _LOADIMAGE("temp.dat", 32)
  119.  
  120. FUNCTION LoadFFX& (Foff&, Size&, Fize%%)
  121.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  122.  OPEN "temp.dat" FOR BINARY AS #3
  123.  dat$ = SPACE$(Size&)
  124.  GET #1, Foff&, dat$
  125.  PUT #3, , dat$
  126.  CLOSE #3
  127.  LoadFFX& = _LOADFONT("temp.dat", Fize%%, "monospace")
  128.  
  129. FUNCTION LoadSFX& (Foff&, Size&)
  130.  IF _FILEEXISTS("temp.dat") THEN KILL "temp.dat"
  131.  OPEN "temp.dat" FOR BINARY AS #3
  132.  dat$ = SPACE$(Size&)
  133.  GET #1, Foff&, dat$
  134.  PUT #3, , dat$
  135.  CLOSE #3
  136.  LoadSFX& = _SNDOPEN("temp.dat")
  137.  
* DarkHouse.MFI (Filesize: 1.78 MB, Downloads: 191)
« Last Edit: December 30, 2020, 10:51:42 pm by Cobalt »
Granted after becoming radioactive I only have a half-life!

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: An Idea.
« Reply #1 on: December 30, 2020, 09:26:38 pm »
Cool!  I say go for it.  I love games like that.  Started a few myself, but never finished one.

Looks fine to me so far.  The screams made my wife peek in the room to see what I was looking at.

- Dav

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: An Idea.(update 1)
« Reply #2 on: January 01, 2021, 01:24:37 am »
Very cool demo.... As Oliver was quoted as having said, "May I have more?"

Fortunately, I was wearing headphones, so 'my' wife was oblivious to the scream... lol

J
Logic is the beginning of wisdom.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: An Idea.(update 1)
« Reply #3 on: January 01, 2021, 11:21:51 am »
@Cobalt

Be sure to keep going, it's very nice. I don't know much about this type of game, but I like what you started.