Array Take Damage - Invader To Take X Amount Of Damage Per Hit
Jun 1, 2012
Working on space invaders still and I want my "invaders" to have a health system. Trying to figure this out but I'm a bit stuck and Im newb to working with arrays. here is what I have but its erroring out on me. I need the invader to take X amount of damage per hit.
Public Sub CheckHit()
For Me.x = 1 To NumOfInvaders
If (Shot.Top + Shot.Height >= Invaders(x).Top) And (Shot.Top <= Invaders(x).Top + Invaders
[CODE]...
View 3 Replies
ADVERTISEMENT
Dec 28, 2010
Basically, i'm creating a space invaders like-game that is 2D Mario-themed (sprites used). I am using a panel for my enemies and Mario is being controlled by the movement of arrow keys and space button shoots.The problem is I can not make my bullets collide with the enemies to make them disappear.This piece of code is what i've got so far with the collision detection :
'*******************************************************************************************************
' Collision occurs whenever the pctShoot(podoboo) hits any of the enemy
' When blnTrue, both pctShoot and the enemy disappear '*******************************************************************************************************
[code]....
While I'm at it, i have another question in concern; but this is not really related to collision but:How do you make an object move down automatically using a timer but make it appear randomly??Like any space invader game, the enemies are shooting back at the hero to make it appear more challenging right?
View 3 Replies
Feb 11, 2007
I'm wanting to put a random amount of data into an array, or an arrayList or some other collection.
Then say>
Dim myItem As Object 'It might be a string or a number or whatever. In this case
Integer or String probably.
' then say>>
[Code].....
View 3 Replies
Dec 28, 2010
i've looked up several tutorials on what i should do to create a collision detection, but im not too positive on how to function my ideas and convert them to code.Basically, i'm creating a space invaders like-game that is 2D Mario-themed (sprites used).I am using a panel for my enemies and Mario is being controlled by the movement of arrow keys and space button shoots.The problem is I can not make my bullets collide with the enemies to make them disappear. This piece of code is what i've got so far with the collision detection :
Code:
'*******************************************************************************************************************************************************
' Collision occurs whenever the pctShoot(podoboo) hits any of the enemy
' When blnTrue, both pctShoot and the enemy disappear
[code].....
While I'm at it, i have another question in concern; but this is not really related to collision but:How do you make an object move down automatically using a timer but make it appear randomly?Like any space invader game, the enemies are shooting back at the hero to make it appear more challenging right?(using Visual Basic 2008)
View 10 Replies
Mar 31, 2012
I have been tasked to create a Visual Basic console script that asks the user 5 times in a row to input a number into an array (sales figures in thousands), Then you display these results as a sort of tally chart.
For example for the data: sales(10,7,12,5,15)
The output would be
2008:++++++++++
2009:+++++++
2010:++++++++++++
[Code]...
how to change the integer value from within the array into a certain number of a single character.
View 2 Replies
Jan 21, 2010
i have a datagridview binded with the datatable via its datasource property....now i want to add the Amount column of the dgv and display the total amount in the textbox,if the amount is greater than a certain value then i want the cell to coloured red so i did this code and it worked great:
Dim i, j As Integer
For i = 0 To DataGridView1.RowCount - 1
j += Me.DataGridView1.Rows(i).Cells("Amount").Value
Next
[code]....
but my problem is that i want the red colour of the cell to blinkafter every 2 seconds....how to do this?i need to handle the timer tick event for this but i am not able to do this.....
View 2 Replies
May 4, 2010
im trying to make a simple program that calculates the time it takes to cover x amount off nautical miles at x amount off knots, the code i have so far is this :
Code:Public Class Form1 Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
[Code]...
so if i say want to cruise 29 miles at 12 knts it gives me an awnser of 2 hours 24.6 mins instead of 2 hours 25. Although i do realise that 2 hrs 24.6 is technicaly right i was wondering if anyone here could help me with getting it into the correct format?
View 4 Replies
Jun 7, 2011
im trying to make a fast food program on which the user will input the amount that he has, then he will check on what he wants, by using check boxes. There are 7 different check boxes with 7 different amounts of money. I have the program somewhat finished (thanks for the people that helped me before) but theres still a couple of things that I still need to get finished but I dont know how to.I need to be able to get how much money the user has (this will be entered threw a text box, I think I accidentally messed this part up, because I cant get it to work right, (theres alreasy a permit amount of money in there and it needs to be what the user enters instead of the permit, 5.59, one) and this will be the maximum amount he can spend, then the user will check on the food he wants (and the program will add the sales tax also) then it will produce an answer saying if you have enough money or if you dont. But what im confused on is how do I get the users amount of money and make it the maximum mount he can spend and make sure it doesnt go over the amount that he has checked.[code]
View 1 Replies
Nov 25, 2009
I am working in a point of sale system in Vb express 2008. I want to convert the Amount in Figures to Words like: How to conver the amount of $ 1,550,325.45 to Amount in words as DOLLARS: ONE MILLION, FIVE HUNDRED FIFTY THOUSAND, THREE HUNDRED TWENTY FIVE AND FORTY FIVE CENTS.
View 2 Replies
Nov 25, 2009
I am working in a point of sale system in Vb express 2008.I want to convert the Amount in Figures to Words like:How to conver the amount of $ 1,550,325.45 to Amount in words as DOLLARS: ONE MILLION, FIVE HUNDRED FIFTY THOUSAND, THREE HUNDRED TWENTY FIVE AND FORTY FIVE CENTS.Please advise how to code for that in Vb express.
View 5 Replies
Mar 13, 2011
how to calculate the amount needed to save up to a certain amount.
Private Sub btnCalc_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim dblSavings As Double
Dim dblFuture As Double
[code]....
View 3 Replies
Jun 19, 2011
I have an array of people stored in a custom structure array... how can i copy this array to a temp array so that the temp array has all the same values as the original custom array?
View 4 Replies
Aug 3, 2011
how to i set 2 number Amount for ... next ? [code]
View 1 Replies
Apr 15, 2012
i have this problem on how to calculate the amount due in our system in VISUAL BASIC.NET .in returning module, (this is for penalty purposes), if the borrower didn't return the book on time, the system must automatically generate the amount due .one daY is equivalent to 10(ten) pesos.so if the borrower didn't return the book with 2 days. the amount due must be 20.00 pesos.
View 6 Replies
Apr 3, 2012
I am using VB (VS 2010) and Wamp Server (Mysql - phpmyadmin). I have a Database Called "TEST" with a Table Called Test1 and 2 columns.
1 = Date
2 = Amount
Like this:
2012-04-04 1,50
2012-04-04 2,33
2012-04-04 5,60
Now what I need is this, I need to get the Sum of the Amount by the Date
2012-04-04 = 9,43
I have this code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
objconn.ConnectionString = "server=localhost;" _
& "user id=root;" _
& "password=root;" _
& "database=test"
Try
[Code] .....
View 6 Replies
Mar 5, 2010
i am new in vb.net programming,need your help.I hv a table named fec which have columns Amt and Date.Now i want to Sum up amount by selecting particular month from date and to display that summed up amount in a textbox.Pls suggest me the whole code using commandbuilder ,i am using access 2007 as back end.
View 2 Replies
Mar 31, 2011
I need to tab over a certain amount of times in a text fileI am using chr(9) for the tab, but I don't want to have to put in a bunch of those.
View 3 Replies
Nov 8, 2009
I am trying to run a program with most and least amount of snowcones.I just cannot get the least amount of snowcones to work.[code].......
View 2 Replies
Jul 12, 2010
I am looking to create a function in which I can pass in an integer (count) and create an amount of picturebox's based on the count.For example if I pass in an integer count, it should do this, only I don't know the correct syntax for it.[code]I am making a huge list of pictureboxes that will scroll on a form, 5 showing at a time.Also, if there are a huge amount of pictureboxes, will I be better off keeping like 7 pictureboxes on the form and keep rotating images throughout? Images are coming from a folderlist in a listbox (so I can easily pull the path of the image from an index).
View 6 Replies
Dec 25, 2011
I've looked everywhere, but I can't find how to do this in VB
View 1 Replies
Jun 11, 2012
i have this formula to get the time used and amount conversion. My problem is that when I a hour dt_total_used.Hour.ToString()) * 60 give wrong result.
'GET TOTAL USED TIME
dt_total_used = dt_end.Subtract(dt_start).ToString
'COMPUTE AMOUNT OF TIME USED
[Code].....
View 10 Replies
Jun 30, 2009
Does anyone know of a way to script falsifying the amount of RAM installed on a PC for an install. I have a program that needs to be installed on many systems that all have little RAM. The program requires during the setup that at least 384 MB of RAM be installed. Some of these systems only have 256 so the install fails. I know the easy answer is install more RAM. Ain't going to happen. Company has no budget. The install should be fine I think, but would like to test more. in order to do the testing to see if this would even work though I need to figure out how to have the OS tell the app it has more RAM than it does. I don't know this app but my first guess is the app queries WMI for amount of RAM?? If that's the case is there a way to set that WMI entry to something different until after the app is done? Or if someone knows another way that would be good too?
View 17 Replies
Sep 2, 2010
I need to induce a variable amount of lag in vb.net. System should be noticeably slower. I can raise the CPU usage of the program with infinite loops and some variable creation/assignments, but how can I actually cause lag? I'd like to have an "InvokeLag" sub which will perform an action to slow down the computer, the faster the function is called the faster it lags. The function should be as mundane as possible, not modifying anything or doing anything to cause damage other than simple lag.
View 3 Replies
Dec 8, 2010
Okay so maybe i'm looking at this problem the wrong way and if I am please tell me but here goes.
View 3 Replies
Jun 14, 2012
how can i breakdown the amount of money into available denominations. for example, i will input 7,542, the program will output how many thousands, hundreds and 1 coins are in the amount. im thinking the trimming functions of VB but no idea how to start.
View 9 Replies
Sep 7, 2009
i need to reduce an amount of time by x% this is what i have so far [code] as u can see ive taken the hours minutes seconds from the time and stored each in a seperate variable so from 02:30:00 i then divided the hours by 60 and then 60 again to give me the total seconds in the hours and then divided the minutes by 60. i then added all 3 to give the total amount of seconds so now the buildtimetotal variable now holds the total in seconds i now need to reducce this by x% all vars are dimentioned as integers except for buildtimehoursback which is a double the problem seems to be when i try to convert the total seconds back to hours minutes seconds.
View 3 Replies
Jul 6, 2011
I'm working on a project for my VB class at school. I am creating a form with several inputs and it calculates the total amount owed for a car sale. I have a text box for input of the TRADE IN VALUE of a car. the program is looking for a numeric input. If there is no trade in, how can i get this box to default to 0.00 so it doesnt error the program?
View 8 Replies
Jul 28, 2010
I am trying to create the following program Store in a 1d array a set of 5 place names and in a 2d array the distances between the places. Ensure that the order of the places is the same in both arrays. When the names are places are input the distance between them is displayed. If they are not both in the table a suitable message is displayed
Dim town(1 To 5) As String
Dim Dist(1 To 5, 1 To 5) As Integer
Dim First As Integer
[CODE]......................
I think the best way forward is pass a parameter to the function findnumber.
View 1 Replies
Jun 2, 2011
how to accumulate the total amount in sql table. I have created a table below but it does not calculate accurately. By mean it just total up current top up amount with the 1st value of grand total. How do i total up to get the accurate figure.
ID Amount GrandTotal
99 1000 1000
99 500 1500
99 300 1300
99 200 1200
View 2 Replies
Aug 22, 2010
I'm trying to calculate the amount of CPU usage my application uses.
My code.
Try
Dim CPU As Integer = CDec(PerformanceCounter2.NextValue.ToString)
Label44.Text = CPU & "%"
[Code]...
The problem is that sometimes it says it uses more 115% hmmm.... That's when i was for sure that its lying to me.
View 5 Replies