Buttons, ifs, and array issues
Author |
Message |
isaiahk9
|
Posted: 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?
Description: |
|
Download |
Filename: |
gallery.t |
Filesize: |
1.43 KB |
Downloaded: |
77 Time(s) |
Description: |
This is the actual program that keeps malfunctioning. |
|
Download |
Filename: |
gallery.t |
Filesize: |
1.42 KB |
Downloaded: |
69 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
darkangel
|
Posted: 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
|
Posted: 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.
|
|
|
|
|
|
|
|