Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Assistance required with structuring a game similar in function to MYST. Mainly switching screens
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
goodatjavabadatturing




PostPosted: Wed May 24, 2023 9:32 am   Post subject: Assistance required with structuring a game similar in function to MYST. Mainly switching screens

What is it you are trying to achieve?
Attempting to create a MYST-like game where screens are switched bwtween using buttons, and puzzles are found throuhgout.


What is the problem you are having?
I seem to have issues with handling more than 2 screens thanks to the way turing interperets proccesses. Is there any way to Correct this issue and have it run as intended?


Describe what you have tried to solve this problem
I have reordered the procedures multiple times, and attempted to bypass the issue by seperating the processes into their own files and using the include command on all of them at the same time. This does not work either


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


%IMPORTANT!!!! Run under regular turing app instead of VScode, item crashes when VSCode debug mode is used
%Pic commands have issue with turing VSCode extension
%this is a certified hood classic
import GUI
var funnysussy:string
var health:int
var x1, y1, b1 : int
var scene:int
var r1:int
var dooropen:int
var ts: array char of boolean
put "tMyst FP alpha 1"
var r2:int
dooropen := 0
delay (500)
cls
delay (1000)
proc switch2
    cls
    setscreen("graphics:1920;1080,nobuttonbar,position:center;center,offscreenonly")
    r2:=Pic.FileNew("screen2.bmp")     
    scene := 2
    Pic.Draw (r2, 0 , 0, picMerge)
    View.Update
    loop
        if dooropen = 0 then
            var buttoninteract:int:=GUI.CreateButton (960, 540,0, "interact" ,puzzle)
            exit when GUI.ProcessEvent
        end if   
    end loop
end switch2
proc switchhandler
switch2
end switchhandler
proc puzzle
cls
setscreen("text:1920;1080,nobuttonbar,position:center,offscreenonly")
View.Update
colour(black)
put "three buttons appear before you, a peice of paper beside them reads, twenty-three is number one"
put "in what order do you push the buttons"
put "(answer with a space between the 3 numbers and NO COMMAS)"
loop
    get funnysussy
    if funnysussy = "231"
        then
        put "correct! The linking book to the age of Channelwood awaits!"
        dooropen:= 1
        delay (2000)
        cls
        switchhandler
    else
        put "incorrect"
        delay (2000)
    end if
    exit when dooropen = 1
end loop
end puzzle
%Set up Game Screen
setscreen("graphics:1920;1080,nobuttonbar,position:center;center,offscreenonly")
colorback(white)
color(black)
View.Update
scene := 1
drawfillbox (0, 0, 200, 50, black)
r1:=Pic.FileNew("room1.bmp")
Pic.Draw (r1, 0, 0, picMerge)

loop
var buttonleft:int:=GUI.CreateButton (50, 0,0, "left" ,switch2)

    exit when GUI.ProcessEvent
end loop
 





Please specify what version of Turing you are using
OpenTuring 1.0.1 under wine, KDE NEON 5.27
Sponsor
Sponsor
Sponsor
sponsor
scholarlytutor




PostPosted: Sat May 27, 2023 4:59 am   Post subject: RE:Assistance required with structuring a game similar in function to MYST. Mainly switching screens

I tried running your code, but I was informed that 'puzzle' has not been declared.

As just some general advice, to simply click the screen and have it switch to another screen, the GUI module is not needed at all, and you can potentially write your code without any processes. It's simpler (at least in my opinion) to use the mousewhere procedure. If you need more than one Window, use the Window module.

I don't have much experience with the GUI module, but if you repost your code so that I can run it, along with pic files, I'll try to see if I can help. Otherwise, give mousewhere a try.
Link1400




PostPosted: Sat May 27, 2023 2:36 pm   Post subject: Re: RE:Assistance required with structuring a game similar in function to MYST. Mainly switching screens

scholarlytutor @ Sat May 27, 2023 4:59 am wrote:
I tried running your code, but I was informed that 'puzzle' has not been declared.

As just some general advice, to simply click the screen and have it switch to another screen, the GUI module is not needed at all, and you can potentially write your code without any processes. It's simpler (at least in my opinion) to use the mousewhere procedure. If you need more than one Window, use the Window module.

I don't have much experience with the GUI module, but if you repost your code so that I can run it, along with pic files, I'll try to see if I can help. Otherwise, give mousewhere a try.


ok
hello there
forgot the password to my old account
yeah i restructured it all to use 3 gui buttons for left, right and center rooms. the issue is fixed now. sorry about this
turns out I overcomplicated things, and it could have been done much easier than i originally intended
scholarlytutor




PostPosted: Sun May 28, 2023 9:19 am   Post subject: RE:Assistance required with structuring a game similar in function to MYST. Mainly switching screens

No worries!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: