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

Username:   Password: 
 RegisterRegister   
 White Lines Wont Move!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
amz_best




PostPosted: Sun Sep 07, 2014 6:24 pm   Post subject: White Lines Wont Move!!!

What is it you are trying to achieve?
Make the white lines move down when i press down or up when i press up


What is the problem you are having?
everything


Describe what you have tried to solve this problem
making diffret set of controls for main menu and for game


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
this is the main menu only
why wont white lines move?
Turing:


%sey.mo.raz << neccesary to open file DO NOT DELETE!



import GUI

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ARRAYS, CONSTANTS, BOOLEAN AND INT VAR'S %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------%
%----------------------------------------------%
                                               %
var game : boolean := false                    %
var titleFont : int                                 
var underTitleFont : int     
var MenuOptions : int
                                        %
var mouseX, mouseY, mouseB :int
var buttonSoundRate : int := 1
var timeAfterButton: real := 0

var buttonOver :boolean := false

var playButtonX: int := maxx - maxx + 175
var playButtonY: int := 475

var choicesMenu: int := 10
var up, down: boolean := false
                                               %
var b_KeyUp : boolean := false                 %
var b_notMoving : boolean := false             %
                                               %
var i_rightTurnCoolDown : int := 6             %
var i_leftTurnCoolDown : int  := 6             %
                                               %
var b_leftKeyDown : boolean := false           %
var b_rightKeyDown : boolean := false          %
                                               %
var shipReset: boolean := false                %
                                               %
var shipX: int := (maxx div 2)                 %
var shipY: int := (maxy div 8)                 %                     
var shipSpeedX: int  := 15                     %
var shipSpeedY: int  := 7                      %                                   
                                               %                             
var speed : int := 1                           %
var size : int := 10                           %
                                               %
var fire : boolean := false                    %
var firey : int := size                        %
var firespeed : int := 1                       %
var firesize : int := 3                        %
var firerate : real := 1                       %
                                               %
var control : array char of boolean            %
                                               %
var bulletX : array 0 .. 300 of int            %
var bulletY : array 0 .. 300 of int            %
var pos_array_size : int := -1                 %
                                               %
var time_after_shot : real := 0                %
                                               %
const c_NumberOfStars := 400                   %
var starX : array 1 .. c_NumberOfStars of int  %
var starY : array 1 .. c_NumberOfStars of int  %
                                               %
%----------------------------------------------%
%----------------------------------------------%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%







View.Set ("offscreenonly")
setscreen ("graphics:max;max,")






%%%%%%%%%%%%%%%%%%%%%%
% PICTURES TO UPLOAD %
%%%%%%%%%%%%%%%%%%%%%%

%-------------------------------------------------------%
var ShipC : int := Pic.FileNew ("ShipC.jpg")           
var ShipL3 : int := Pic.FileNew ("ShipL3.jpg")          %
var ShipR3 : int := Pic.FileNew ("ShipR3.jpg")          %
var ShipL2 : int := Pic.FileNew ("ShipL2.jpg")          %
var ShipR2 : int := Pic.FileNew ("ShipR2.jpg")          %
var ShipL1 : int := Pic.FileNew ("ShipL1.jpg")          %
var ShipR1 : int := Pic.FileNew ("ShipR1.jpg")          %

var playButton: int := Pic.FileNew ("playButton.jpg")
var Level1Enemy: int := Pic.FileNew("Level 1 Enemy.jpg")%
var bullet : int := Pic.FileNew ("bullet.jpg")          %
%-------------------------------------------------------%

process menuMusic
    loop
           Music.PlayFile ("MainMenu.mp3")
    end loop
end menuMusic

process bOver

        Music.PlayFile ("RollOver.wav")

end bOver


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  THE FOR STATEMENTS FOR THEM BULLETS AND THEM STARS     %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%---------------------------------------------------%
%for bullets                                        %                                       
for i : 0..300                                      %
    bulletY(i) := 0                                 %
    bulletX(i) := 0                                 %
end for                                             %
                                                    %
%for stars                                          %
for star : 1 .. c_NumberOfStars                     %
    starX (star) := Rand.Int (0, maxx)              %
    starY (star) := Rand.Int (0, maxy)              %
end for                                             %
%---------------------------------------------------%



%FONTS FOR TEXT!!!
titleFont := Font.New("ALGERIAN:100")
underTitleFont := Font.New("Corbel:30")
MenuOptions := Font.New("Miriam FIXED:40")


%MAIN MENU
if game = false then


      Draw.FillBox (0, 0, maxx, maxy, black)
      Font.Draw(" The Void ", (maxx div 2 - 300), (maxy div 1.25), titleFont, 40)
      Font.Draw("< Space Shooter beta 4b >", (maxx div 2 - 200), (maxy div 1.4), underTitleFont, 103)
      Font.Draw("Play", (maxx div 2 - 50), (maxy div 1.8), MenuOptions, 44)
      Font.Draw("Options", (maxx div 2 - 90), (maxy div 1.8 - 100), MenuOptions, 44)
      Font.Draw("Controls", (maxx div 2 - 110), (maxy div 1.8 - 200), MenuOptions, 44)
      Font.Draw("Extra", (maxx div 2 - 65), (maxy div 1.8 - 300), MenuOptions, 44)

     
     
      if choicesMenu = 10 then 
      Draw.Box(0, (maxy div 1.8 + 50),maxx,(maxy div 1.8 - 25),white)
      end if
      if choicesMenu = 20 then
      Draw.Box(0, (maxy div 1.8 - 50),maxx,(maxy div 1.8 - 125),white)
      end if
      if choicesMenu = 30 then
      Draw.Box(0, (maxy div 1.8 - 150),maxx,(maxy div 1.8 - 225),white)
      end if
      if choicesMenu = 40 then
      Draw.Box(0, (maxy div 1.8 - 250),maxx,(maxy div 1.8 - 325),white)
      end if
     
      if choicesMenu = 50 then
      choicesMenu := 10
      end if
     
      if choicesMenu = 0 then
      choicesMenu := 40
      end if
   
     
      if up = true then
        choicesMenu -= 10
        up := false
        end if
      if down = true then
        choicesMenu += 10
        down := false
       
    loop
        Input.KeyDown (control)
           if control (KEY_UP_ARROW) then
           up := true
           end if
           if control (KEY_DOWN_ARROW) then     
           down := true
           end if
    end loop

       
       
       

end if
     fork menuMusic
end if


Please specify what version of Turing you are using
open turing 1.0
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Sep 07, 2014 7:19 pm   Post subject: RE:White Lines Wont Move!!!

code:

    loop
        Input.KeyDown (control)
           if control (KEY_UP_ARROW) then
           up := true
           end if
           if control (KEY_DOWN_ARROW) then     
           down := true
           end if
    end loop

This loop will never exit.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
amz_best




PostPosted: Sun Sep 07, 2014 7:21 pm   Post subject: RE:White Lines Wont Move!!!

how do i make it so dat is does move the lines?
amz_best




PostPosted: Sun Sep 07, 2014 7:51 pm   Post subject: RE:White Lines Wont Move!!!

nvm, i got it!
all i did was add cls, view update and time delay and it worked! im also fixing the code a bit so the sounds dont spam xD
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: