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

Username:   Password: 
 RegisterRegister   
 Need help to Jump Start my ISU!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
vdemons




PostPosted: Tue May 10, 2011 7:49 pm   Post subject: Need help to Jump Start my ISU!

I am trying to make a game where 4 different colored boxes appear on the screen and flash in a random sequence, then you have to repeat it by clicking on the boxes with the same sequence of colors, I am a novice and I don't know how to start off with this project. So I ask kindly for help, I don't need you to do it for me, just tell me the structure on how I might attempt on doing it and some of the commands I might need to learn to do this task.

Please and Thank you in advance!
Sponsor
Sponsor
Sponsor
sponsor
apython1992




PostPosted: Tue May 10, 2011 8:23 pm   Post subject: RE:Need help to Jump Start my ISU!

Well...what ideas do you already have? Does this include any code?
HRI




PostPosted: Sat May 14, 2011 6:31 pm   Post subject: Re: Need help to Jump Start my ISU!

For starters, Rand.Int (low, high) produces a random integer in that range (colour is an integer)

drawfillbox (x,y,x2,y2,colour) draws a rectangle with lower left corner (x,y) and upper right corner (x2,y2)

drawbox does the same without filling it

delay (milliseconds) works for waiting so the user will see the flash

putting Mouse.Where (x,y,button) at the top of the loop you use those variables in will keep track of the mouse's coordinates and whether a button is being pressed (you might want to delay after they click one, and note that this, unlike Mouse.ButtonWait will assume true for as long as they hold it down)

use Font.New and Font.Draw to make your own fonts and use them

you can use a dynamic array in your main loop to store the sequence and the clicked sequence. upper (arrayName) will return the max of the range
Turing:
var sequence : flexible array 1..0 of int % assign buttons numbers
var user : flexible array 1..0 of int

%level 1
new sequence, upper (sequence) + 1 %adds a slot onto the end of sequence

%do the same for user
%calculate sequence knowing upper (sequence) is how many elements there are
%get user sequence and check it
%increment level
%repeat until user gets it wrong


Most of the code is there for you, you just have to implement it correctly. Pressing F10 while working will bring up a nice reference that includes all of these commands.

Also, note that using offscreenonly and View.Update (use as little as possible) will reduce flickering
Raknarg




PostPosted: Sat May 14, 2011 6:36 pm   Post subject: RE:Need help to Jump Start my ISU!

Just take it piece by piece. Start with the main game by getting random squares to flash in a random sequence. Thats a good place to begin.
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: