Consulting

Results 1 to 6 of 6

Thread: Medical Terminology Point-and-Click Adventure Game Issues

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question Medical Terminology Point-and-Click Adventure Game Issues

    Hi all! I'm developing a medical terminology game for class. It's a point-and-click adventure game where the player has to search the hospital for hidden terms, and once they've found all the terms in a level, they can advance. There are trackers in the top right-hand corner that display 1.) the level #, 2.) the rooms completed [RoomsComp], and 3.) # of terms collected [TermCounter]. The issue is that I have 5 different background images, and therefore 5 different layouts with trackers (Level, RoomsComp, & TermCounter). Because of this, I have to reference all iterations of the tracker throughout.

    For example, this is the code that runs when a player clicks on an invisible shape in a room that contains a hidden term:

    Sub FOUNDT1()
    If T1.Caption = 0 Then
        T1.Caption = (T1.Caption) + 1
        TermCounter.Caption = (TermCounter.Caption) + 1
        SlideLayout56.TermCounter.Caption = (TermCounter.Caption)
        SlideLayout55.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        SlideLayout57.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        SlideLayout59.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        If (T2.Caption) + (T3.Caption) + 1 = 3 Then
            RoomsComp.Caption = (RoomsComp.Caption) + 1
            SlideLayout56.RoomsComp.Caption = (RoomsComp.Caption)
            SlideLayout55.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
            SlideLayout57.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
            SlideLayout59.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
        Else
        ActivePresentation.SlideShowWindow.View.GotoSlide (30)
        End If
    Else
    ActivePresentation.SlideShowWindow.View.GotoSlide (31)
    End If
    End Sub
    Q1: So the code for the TermCounter works, but I'm wondering--is there a way that "TermCounter" could apply to all iterations of the TermCounter label throughout the game? (My professor mentioned global variables being a potential solution?)
    Q2: The RoomsComp does not currently work. In this level, there are 2 rooms, each with 3 terms hidden in them. Do you all see any issues with the code here? If so, how should I rewrite it?

    Thanks so much! I'm also happy to upload the game if that would help!
    Last edited by Paul_Hossler; 11-17-2019 at 11:13 AM. Reason: Added CODE tags

  2. #2
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    618
    Location
    .
    Having the file to review for edits would help very much.

  3. #3
    VBAX Newbie
    Joined
    Oct 2021
    Posts
    1
    Location
    Wow, thanks a lot for this information, i have similar issue, im also developing game for computer class in school! You code might help me!

  4. #4
    Q1: To make "TermCounter" apply to all iterations of the TermCounter label throughout the game, you can use global variables. Global variables can be declared outside of any sub or function and can be accessed from anywhere in the code.


    Q2: The issue with the RoomsComp code might be that the condition (T2.Caption) + (T3.Caption) + 1 = 3 may not be evaluating as expected. You might need to review the logic and condition for incrementing the RoomsComp. If you share the relevant code or more details, I can provide more specific assistance.

  5. #5
    Quote Originally Posted by IDTstudent View Post
    Hi all! I'm developing a medical terminology game for class. It's a point-and-click adventure game where the player has to search the hospital for hidden terms, and once they've found all the terms in a level, they can advance. There are trackers in the top right-hand corner that display 1.) the level #, 2.) the rooms completed [RoomsComp], and 3.) # of terms collected [TermCounter]. The issue is that I have 5 different background images, and therefore 5 different layouts with trackers (Level, RoomsComp, & TermCounter). Because of this, I have to reference all iterations of the tracker throughout.

    For example, this is the code that runs when a player clicks on an invisible shape in a room that contains a hidden term:

    Sub FOUNDT1()
    If T1.Caption = 0 Then
        T1.Caption = (T1.Caption) + 1
        TermCounter.Caption = (TermCounter.Caption) + 1
        SlideLayout56.TermCounter.Caption = (TermCounter.Caption)
        SlideLayout55.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        SlideLayout57.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        SlideLayout59.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        If (T2.Caption) + (T3.Caption) + 1 = 3 Then
            RoomsComp.Caption = (RoomsComp.Caption) + 1
            SlideLayout56.RoomsComp.Caption = (RoomsComp.Caption)
            SlideLayout55.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
            SlideLayout57.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
            SlideLayout59.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
        Else
        ActivePresentation.SlideShowWindow.View.GotoSlide (30)
        End If
    Else
    ActivePresentation.SlideShowWindow.View.GotoSlide (31)
    End If
    End Sub
    Q1: So the code for the TermCounter works, but I'm wondering--is there a way that "TermCounter" could apply to all iterations of the TermCounter label throughout the game? (My professor mentioned global variables being a potential solution?)
    Q2: The RoomsComp does not currently work. In this level, there are 2 rooms, each with 3 terms hidden in them. Do you all see any issues with the code here? If so, how should I rewrite it?

    Thanks so much! I'm also happy to upload the game if that would help!
    hello,
    Q1: To apply "TermCounter" globally, use global variables. Define `global TermCounter` in your function to ensure it's accessible across all iterations. This allows consistent tracking throughout the game.

    Q2: Check for issues in `RoomsComp` code, such as incorrect term references or room logic errors. Ensure each room's term count is correctly updated. Rewrite the code to properly handle term identification and room boundaries.

  6. #6
    Quote Originally Posted by IDTstudent View Post
    Hi all! I'm developing a medical terminology game for class. It's a point-and-click adventure game where the player has to search the hospital for hidden terms, and once they've found all the terms in a level, they can advance. There are trackers in the top right-hand corner that display 1.) the level #, 2.) the rooms completed [RoomsComp], and 3.) # of terms collected [TermCounter]. The issue is that I have 5 different background images, and therefore 5 different layouts with trackers (Level, RoomsComp, & TermCounter). Because of this, I have to reference all iterations of the tracker throughout.

    For example, this is the code that runs when a player clicks on an invisible shape in a room that contains a hidden term:

    Sub FOUNDT1()
    If T1.Caption = 0 Then
        T1.Caption = (T1.Caption) + 1
        TermCounter.Caption = (TermCounter.Caption) + 1
        SlideLayout56.TermCounter.Caption = (TermCounter.Caption)
        SlideLayout55.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        SlideLayout57.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        SlideLayout59.TermCounter.Caption = (SlideLayout56.TermCounter.Caption)
        If (T2.Caption) + (T3.Caption) + 1 = 3 Then
            RoomsComp.Caption = (RoomsComp.Caption) + 1
            SlideLayout56.RoomsComp.Caption = (RoomsComp.Caption)
            SlideLayout55.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
            SlideLayout57.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
            SlideLayout59.RoomsComp.Caption = (SlideLayout56.RoomsComp.Caption)
        Else
        ActivePresentation.SlideShowWindow.View.GotoSlide (30)
        End If
    Else
    ActivePresentation.SlideShowWindow.View.GotoSlide (31)
    End If
    End Sub
    Q1: So the code for the TermCounter works, but I'm wondering--is there a way that "TermCounter" could apply to all iterations of the TermCounter label throughout the game? (My professor mentioned global variables being a potential solution?)
    Q2: The RoomsComp does not currently work. In this level, there are 2 rooms, each with 3 terms hidden in them. Do you all see any issues with the code here? If so, how should I rewrite it?

    Thanks so much! I'm also happy to upload the game if that would help!
    Your code has had a profound impact on my classroom assignments, thank you for sharing.
    Last edited by georgiboy; 08-20-2024 at 08:02 AM. Reason: Removed spam

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •