how do i make it when i click my picture goes up. and when i let go it goes
Printable View
how do i make it when i click my picture goes up. and when i let go it goes
in mousedown:
pic.top = pic.top - 1
hmmm.....that dont work...lemme explain more
im making a game like this
ok...
create a boolean, called GoingUp, for instance
create an integer (or long) called NewY, for instance.
in form_load, set newy to picturebox.height / 2 (the center of the picturebox)
in the pictureboxes mousedown event, set GoingUp = True
on mouseup, set GoingUp = False
create a main loop where you will draw the helicopter and do some calculations.
in it, add the code:
VB Code:
If GoingUp = True Then NewY = NewY - 1 If GoingUp = False Then NewY = NewY + 1
then add the code for drawing the helicopter, but use the NewY instead of the Y value you used before...
It looks like the game is using acceleration. It goes faster up after you have hold down the mouse. So you may want to use an acceleration variable (double) too. So when you push down the mouse, the acceleration goes from something like 0.05 too 2 or something like that. The first time the loop goes, it will move the helicopter 0.05 pixels up (it actually want move it that slow), and the next time the loop is running the acceleration is bigger, something 0.05 + 0.05 and then the helicopter will move 0.1 pixels up...and so on.
o.....this includes math....*click*
all games use math :rolleyes: they're fun to play, not all are fun to make:cool:
Of course it's math....math and physics...that’s what it's all about. You got to love it... ;)
thats right :)
hey! i've made a small program with some of the basic things in the helicopter game...
try it! :)
if you ask me, you'd be better off making it in flash :) And really, the actionscript is basically the same format...
It's much more fun to make a game in VB then in Flash (That’s at least what I think).
Cyborg: That was a kind of cool. Now it is just lacking collision detection, and it should be a little bit bigger. Because sometimes you can't do anything to avoid a collision because you have too little time. And the third thing is the "floor" and "roof" of the game. Nice one.
:)
how do you make games in flash? you cant to object collision and borders can you?Quote:
Originally posted by kandieman101
if you ask me, you'd be better off making it in flash :) And really, the actionscript is basically the same format...
What are you talking about? Of course you can. The objects have x and y values too, and furthermore, I think you have much more control over the game, and it will certainly be much smoother.Quote:
Originally posted by duc
how do you make games in flash? you cant to object collision and borders can you?
Also, many more games are made in flash than there are in VB
Small games are maybe easy to make in Flash, but I don't think more complex are (I don't know, because I have never made a game in flash). When you want 3D, Maps, and databases in your game, I would go for VB and not Flash, or actually C/C++ would be better....
heres the game with collition detection!
Nice nice...I had a little "bug" in the old version, but I couldn't figure it out. It seemed like some times when I clicked the mouse, the helicopter wouldn't go up. But when I tried Version 2, I discovered that I double clicked the mouse. And then the game didn't set the 'GoingUp = True'. So you should add this lines too your code, and it would be easier to play....
Private Sub PicDisp_DblClick()
GoingUp = True
End Sub
actually i thought about that too....
i'll add that...and also make the floor and roof.....
do you have any ideas on how to make them?
I agree about not using flash to make complex games, but I would still have to say I think it is better than VB. Flash has database access, and 3d graphics are very easy to use with flash.
Nevertheless, I do agree that both flash and vb are not ideal for 'good games'. At that is probably why C++ is used for most games...
I thougt about drawing lines from the roof start to the bottom in the green color or wahat ever. Make an array, with the length of the screen. So it can hold the start of the roof. So the array would look something like this 30, 30, 30, 29, 28, 27, 26, 26, 26, 26... making the roof look like a line that first goes horisontalt and then little bit up, before it goes forward. And every time the screen moves 1 pixel forward, you have to add a new hight of the roof on the end of the array (but first you have to move all the numers one index to the front, so the first numer are not a part of the array, but the it is room, for one more. And then you can paint the roof by doing a loop of the array and fraw lines from the arrays number and to x = 0.
Doing the same to the floor.
Here some some methods I thought of off the top of my head:
1) Your way - always decreasing roof/floor
2) Make screen move faster
3) Make objects taller/longer (longer can also affect it...)
4) Different objects... not just constant retangles, that I think are easy to avoid.
I think you have a good game going, but if you ask me... the way you are heading, you are basically asking for help, and wondering how to COPY that helicopter game. Don't. Change things.
ok...you're right...i'll change as much as i can do, but first i have to get all the basic things going!
hey duc......could you change the topic to something about helicopter game please :)
Now i've changed the game so much that you can't almost see that its based in the helicopter game :)
there are still some things to add...
HEHEHEH....this is a nice game....lol....
hehe! thanks! :)
added some things....
sounds....animations....and some other nice stuff! :)
check it out!
Snygt snygt snygt...
Do you never sleep, or go too school Cyborg. I know that small kids like you are supposed to go too school in Sweden. But I love the game. Can't say anything else. Just got too love it.
thank you very much! :)
yes, i go to school....but i've been a bit ill the last week, so i havent been there much...
we dont have to go to school in sweden after 9th grade...
but if we want a good job, we have to :(
new version of fish game!
too large to attach, so i've uploaded it on geocities:
http://www.geocities.com/mp_crew2001/
Cyborg, good game, but last time I checked, fish dont have 'trails'... ew... :)
hehehe....that supposed to look like waves.... :rolleyes:
im not good with gfx :p
**** you guys are good. how do u create commands in flash (i have flash mx)