Sign in to follow this  
ccrock4t

BlitzBasic not changing a variable?

Recommended Posts

Hello,

I'm using Blitz3d and I'm making a 2d puzzle game fro practice.

I'm simply trying to make it so if the images touch the button changes color.

If button1 = 1 then the button should be red
if button1 = 2 then the button should be pink

If I set button1 = 2 at the beggining (as opposed to 1) then button will be pink, so it's obviously detecting the variable

Also, when the bullet hits the button, it dissapears, so I know there is a collision happening.

sealy in the y coordinate
sealx is the x coordinate.

[source lang="plain"]For bull.bullet = Each bullet
If bull\sealx = 600 And bull\sealy = 0
Delete bull.bullet
If button1 = 1 Then
button1 = 2
ElseIf button1 = 2 Then
button1 = 1
EndIf
EndIf
Next[/source]

Since the bullet is disappearing, it's obvious the collision is working. But why isn't the bullet drawing?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this