Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Arcade Game Written in VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00531577
Message ID:
00531629
Vues:
17
>Hello!!
>
>Being an avid gamer and having written games in previous lives, I of course was naturally curious as to how a game would work written in VFP. After various experimentations I have written the framework for a side scrolling platform game written solely in VFP (On my off hours, of course :)). This framework includes sound routines, joystick routines, smooth scrolling, and object collision and detection routines. I basically used subclassed image object as the different items that can be picked up, moved, walked on etc. I use sys(1270) as my collision detection routine. All of this works great except for ONE thing. You guessed it. TOO SLOW. On a P3 system with say 600mhz or higher processor everything works great. But running on a P2 with say a 300mhz it's just a little too slow.
>
>My question to all you API gurus out there is if you might know a way to use API calls (maybe BITBLT) to move an object instead of just repositioning the left and top properties of it as I am doing now. If I could speed up the moving of the actual main sprite character perhaps using API calls then it could run on a slower system.
>
>Other than that, I am amazed at how professional this game is looking using a language like VFP without doing hardly any low level stuff. It's a totally different way to do object collision and detection than what I've done in the past but very interesting.
>
>Any thoughts or comments would be very much appreciated.
>
>Thanks!

Kevin,

I don't think that BitBlt() is what you'd use here. Here's what it does courtesy of the Platform SDK: "The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context."

What you need to do is move the window. SetWindowPos() might be of help.

Assuming that you're using the main VFP desktop, another suggestion might be to lock the desktop (via LockWindowUpdate()) then set the top and left properties, then un-lock it.

Let me know if you're interesting in pursuing either of these.

As a side note, I wrote a VFP version of the puzzle game that was in FPD/FPW. One of the problems there was how to move the buttons around. In that case, the solution was simple: don't! Change the captions and the visibility of one of the buttons. I don't know if this would apply to your situation, but perhaps something "outside the box" might be.< s >
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform