Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Eggbug Party Games | Decker Camp 2024

A topic by Sysl created Aug 02, 2024 Views: 146 Replies: 5
Viewing posts 1 to 6
(+5)

Hey everyone,

I made DeckerWare - Eggbug party games and I wanted to talk about how I made some of the effects:

Sound/Music

I wrote a small batch script that let me drop things on the .bat and turn them into wav files that were placed in C:/temp/

set OUTM=%~n1 set OUTALL=c:/temp/%OUTM%.wav ffmpeg.exe -i "%~1" "%OUTALL%"

I used this to find short loops for game music and the sound effects that I've found online/are from the GDC packs.

In the Decker Project I wrote some Deck Level functions for playing music and sounds. They check if on the home card if music/sounds are disabled before playing.

MEMORY:save.widgets # the MEMORY function is just shorthand for a card that I store widgets on. 
# I called the card 'save'.
(+3)
on sfx sname do
  if !home.widgets.nosound.value
    play[sname]
  end
end
on stop_music do
 play[0 "loop"]
 MEMORY["current_song"].text:"none"
end
on music_stop do
 stop_music[]
end
on play_music mname do
 if !home.widgets.nomusic.value
   play[mname "loop"]
   MEMORY["current_song"].text:mname
 else
   stop_music
 end
end 
(+3)

For the songs we store the current song playing in case we need to use that later.


For organizing songs, I stored anything that was a music loop with the prefix "music_".

Then in the rest of the deck it was easy to do play_music["music_adventure"] or sfx["pop"].

----------

(3 edits) (+2)


  1. Create a slider widget on another card to act at memory for the timer.
    ptimer
  2. If you want, make accessing it easier with a deck level script:
    MEMORY:save.widgets
  3. In your card script, make the timer go up on every view of the card.
    MEMORY["ptimer"].value:MEMORY["ptimer"].value+1
  4. Paint your letters with alternating colors from the color view in decker 
  5. Choose values for when you want the colors to switch, and switch the colors in lil code. In the last change, reset the timer.
    if MEMORY["ptimer"].value > 20
    patterns[33]:"%h" parse "ff4f69"
    patterns[34]:"%h" parse "ff8142"
    end
    if MEMORY["ptimer"].value > 40
    patterns[34]:"%h" parse "ff4f69"
    patterns[33]:"%h" parse "ff8142"
    MEMORY["ptimer"].value:0 # Reset the timer so the colors change on loop.
    end
  6. Make sure you include go[card] at the end of your card script so the card script runs on a loop.
  7. You're done!
(+2)

Remembering Things

If you don't want to pass state around, having a deck page that's just for tracking flags (with a reset button) is a good way of keeping track of things.


(+1)

All of the Minigames follow the same basic template:   

##################################################################################
# Config
#################################################################################
minigame_countdown_speed:MEMORY["mgspeed"].value
#################################################################################
# View Callback
#################################################################################
on view do
 #################################################################################
 # Reset The Minigame
 #################################################################################
 if save.widgets["isdirty"].value = 0
  MEMORY["iswin"].value:0
  timer.value: 800
  play_music["music_tense"]
  save.widgets["isdirty"].value:1
 end
 #################################################################################
 # Minigame Events
 #################################################################################
 #################################################################################
 # Run on Win
 #################################################################################
 if MEMORY["iswin"].value
     if !MEMORY.r1.value
      MEMORY.r1.value:1
      sfx["winsound"]
    end
 end
 #################################################################################
 # Countdown The Timer
 #################################################################################
 timer.value:timer.value-minigame_countdown_speed
  #################################################################################
 # If win speed up timer
 #################################################################################
 if MEMORY["iswin"].value
   timer.value:timer.value-minigame_countdown_speed*2
 end
 #################################################################################
 # TImer Text
 #################################################################################
 if timer.value<300
   timer.format:"Hurry Up!!!"
  else
    timer.format:"Game Time Remaining"
  end
  #################################################################################
 # Out of time
 #################################################################################
 if timer.value ! 0
  go[card]
 elseif timer.value = 0
  go[mg_parent]
 end
end
  1.    We keep track if this is a fresh view of the card
  2. If it is, we reset the minigame actors
  3. We loop the card script until the timer runs out
  4. During this we track if they won the minigame so we can take away a life if they did not.
  5. If the player wins, we make the timer go down faster


All of the minigame ideas come from the contraption collections and the collision check from the decker documentation.