Results 1 to 33 of 33

Thread: make the image go up and the let 'er down

  1. #1

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702

    make the image go up and the let 'er down

    how do i make it when i click my picture goes up. and when i let go it goes
    Last edited by duc; Nov 16th, 2002 at 11:07 PM.

  2. #2
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    in mousedown:
    pic.top = pic.top - 1
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  3. #3

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    hmmm.....that dont work...lemme explain more

    im making a game like this

  4. #4
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    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:
    1. If GoingUp = True Then NewY = NewY - 1
    2. 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...
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  5. #5
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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.

  6. #6

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    o.....this includes math....*click*

  7. #7
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    all games use math they're fun to play, not all are fun to make

  8. #8
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Of course it's math....math and physics...that’s what it's all about. You got to love it...

  9. #9
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    thats right
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  10. #10
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hey! i've made a small program with some of the basic things in the helicopter game...

    try it!
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  11. #11
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    if you ask me, you'd be better off making it in flash And really, the actionscript is basically the same format...
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  12. #12
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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.

  13. #13

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    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...
    how do you make games in flash? you cant to object collision and borders can you?

  14. #14
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    Originally posted by duc
    how do you make games in flash? you cant to object collision and borders can you?
    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.

    Also, many more games are made in flash than there are in VB
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  15. #15
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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....

  16. #16
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    heres the game with collition detection!
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  17. #17
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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

  18. #18
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    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?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  19. #19
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    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...
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  20. #20
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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.

  21. #21
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    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.
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  22. #22
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    ok...you're right...i'll change as much as i can do, but first i have to get all the basic things going!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  23. #23
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hey duc......could you change the topic to something about helicopter game please
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  24. #24
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    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...
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  25. #25
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    HEHEHEH....this is a nice game....lol....

  26. #26
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hehe! thanks!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  27. #27
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    added some things....
    sounds....animations....and some other nice stuff!
    check it out!
    Attached Files Attached Files
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  28. #28
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    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.

  29. #29
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    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
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  30. #30
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    new version of fish game!
    too large to attach, so i've uploaded it on geocities:
    http://www.geocities.com/mp_crew2001/
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  31. #31
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Cyborg, good game, but last time I checked, fish dont have 'trails'... ew...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  32. #32
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hehehe....that supposed to look like waves....
    im not good with gfx
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  33. #33

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    **** you guys are good. how do u create commands in flash (i have flash mx)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width