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

Username:   Password: 
 RegisterRegister   
 Buttons, ifs, and array issues
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
isaiahk9




PostPosted: Sun Apr 27, 2008 3:34 pm   Post subject: Buttons, ifs, and array issues

As a final project, I am creating a main menu for the project (it's a game). In the main menu, there will be a "Gallery" - using an array and buttons, the user can scroll through 90 pictures. However, nothing is working - first I used 90 pictures, and then an "Illegal Picture ID" message would appear for random pictures. As well, after I only used the first 20 pictures (they were bug-free), the program wouldn't use the buttons. Anyway, I was hoping that if I posted the code on compsci.ca someone would be smart enough (and generous enough) to help me through this problem. If anybody will help, here is the code. Unfortunately, the pictures will not upload, basically the idea is that there is a picture on the middle of the top of the screen, and buttons nearer the bottom, as indicated in the code.
P.S. - when at slide 0 and the user clicks back or last slide and user clicks next, do I use an if loop to stop them?



gallery.t
 Description:
This is the program.

Download
 Filename:  gallery.t
 Filesize:  1.43 KB
 Downloaded:  77 Time(s)


gallery.t
 Description:
This is the actual program that keeps malfunctioning.

Download
 Filename:  gallery.t
 Filesize:  1.42 KB
 Downloaded:  69 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
darkangel




PostPosted: Tue Apr 29, 2008 6:07 pm   Post subject: Re: Buttons, ifs, and array issues

Well without the pictures, its hard to help alot but why not just put a delay() after you hit a button?
And also, you should use Input.KeyDown() or Mouse.Where(), they are way simpler and more effective.
isaiahk9 @ Sun Apr 27, 2008 3:34 pm wrote:

P.S. - when at slide 0 and the user clicks back or last slide and user clicks next, do I use an if loop to stop them?

Just make it so
IF BACK AND SLIDE = 0 THEN
SLIDE = MAX
ELSIF FORWARD AND SLIDE = MAX THEN
SLIDE = 0
END IF
isaiahk9




PostPosted: Wed May 07, 2008 7:57 pm   Post subject: RE:Buttons, ifs, and array issues

The delay worked, and I used an if loop to stop going back from slide 1. Took me a week to figure it out.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: