JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!



i have a serious problem, you can help easily


B

keyboard_arrow_up
0
keyboard_arrow_down


First Post Mark as Spam bluesage
Posts: 1 - Registered: 2007-01-14 10:46:41

I am in uni and i only have a short while to reprogram this ****ty application. if i fail then i will have wasted over £16000 on uni and will fail the course and woin't be able to go back to university ever again... please help!!!!!!!

1) I need to make the images move form left to right rather than right to left.

2) i need to add a set of radio buttons to my form so that instead of 4 random cars being added, you manually select cars instead.

if you need anything else please let me know, if you can help me please do... PLEASE!!!

basic description-

PLEASE IF YOU CAN HELP ME PLEASE HELP ME!!!!

here's the code. if you need anything else to help me please let me know asap!
---

Public Class frmWackyRaces

Private Sub btnSelectCars_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectCars.Click
For Each pct As PictureBox In pnlRaceTrack.Controls
Select Case Int(Rnd() * 11)
Case 0
pct.Image = My.Resources.ArkansasChugABug
Case 1
pct.Image = My.Resources.ArmySurplusSpecial
Case 2
pct.Image = My.Resources.BoulderMobile
Case 3
pct.Image = My.Resources.BulletProofBomb
Case 4
pct.Image = My.Resources.BuzzWagon
Case 5
pct.Image = My.Resources.Compact*****Cat
Case 6
pct.Image = My.Resources.ConvertACar
Case 7
pct.Image = My.Resources.CreepyCoupe
Case 8
pct.Image = My.Resources.CrimsonHayBailer
Case 9
pct.Image = My.Resources.MeanMachine
Case 10
pct.Image = My.Resources.TurboTerrific
End Select
Next
btnStartRace.Enabled = True
End Sub

Private Sub btnStartRace_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStartRace.Click
btnSelectCars.Enabled = False
tmrRace.Enabled = True
btnStartRace.Enabled = False
End Sub

Private Sub tmrRace_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrRace.Tick
For Each pct As PictureBox In pnlRaceTrack.Controls
pct.Left = pct.Left - Int(Rnd() * 30)
If pct.Left <= 0 Then
tmrRace.Enabled = False
btnReset.Enabled = True
lblWinner.Left = pct.Left + pct.Width
lblWinner.Top = pct.Top + pct.Height / 2
lblWinner.Visible = True
End If
Next
End Sub

Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReset.Click
For Each pct As PictureBox In pnlRaceTrack.Controls
pct.Image = Nothing
pct.Left = pnlRaceTrack.Width - pct.Width
Next
btnSelectCars.Enabled = True
btnReset.Enabled = False
lblWinner.Visible = False
End Sub

Private Sub frmWackyRaces_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
End Sub
End Class
---
here are some images of the form i am working on-
http://i176.photobucket.com/albums/w...rminactive.jpg

http://i176.photobucket.com/albums/w...formactive.jpg




I

keyboard_arrow_up
0
keyboard_arrow_down


Reply #1 Mark as Spam instinct46
Posts: 92 - Registered: 2007-03-27 08:07:09

I'm not sure what your programming in I get the feeling its cpp with visual studio or something of which I haven't a clue about, but when programming games in SDL for movement left to right theirs usually an x movement varible which depending on how far you want it to move is 1+

now if you want it to move right to left its the same except you find the varible which you wish to change and replace its positive number with a negative, -1 or -15 yet again depends on how much you want it to move.

Hope this helps and sorry I can't help any further






JOIN DEVPPL

It looks like you are new here. If you want to get involved, click on Join below!




MENU
Advertising