|
Post by yeroen1954 on Nov 2, 2018 0:02:06 GMT
I made this game, MouseTrap, in the old b4gl in 2005 for Windows. Now in 2018 adapted in Basic4GLmobile to run it on Android devices. In retrospect, I would have done better to redevelop the whole. The source code has now unfortunately become a mess. Nevertheless, it appears to work very well on Android. But... In Windows with a keyboard I liked to play. In Android everything is different ... I have not finished yet. Do not have enough control over the technique. Look at it and shoot me. For clarity: I only send the source code and associated files. You can run and view this in Windows with Basic4GLmobile. However, there is no APK file. If you want to watch it on an Android device: you must copy the file -program.vm (see instructions from Basic4GLmobile). I am curious about the experience of other users. Greeting, Yeroen SentMouseTrap.7z (429.53 KB)
|
|
|
Post by Tom on Nov 3, 2018 6:59:37 GMT
I made this game, MouseTrap, in the old b4gl in 2005 for Windows. Now in 2018 adapted in Basic4GLmobile to run it on Android devices. ... Hi Yeroen. It's good to see some activity around here :-) There's some game input routines that come bundled with Basic4GL Mobile that might be helpful. Particularly the standard\gameinput.inc file, which contains a routine for getting directional and button input. On PC it reads the arrow keys, but on Android it displays touch input controls. I used to to convert Peter's "Sokomouse" game, but unfortunately I haven't been able to contact him to get permission to release it. Here's a simple example: ' Standard game input routines. ' These are included in the "Basic4GL Mobile" folder that the installer creates. ' If you save your program somewhere else, you will need to copy the "standard" folder into the same location, ' as well as the "gfx" folder, which contains the images it requires to display the UI on Android. ' The "gfx" folder must also be copied to the "basic4gl" folder on Android (along side program.vm) include standard\gameinput.inc
resizetext(40,30) settextscroll(false) cls dim x = 20, y = 15, xd = 0, yd = 0
' Configure the input we need uiGamepadDef.joystick.mode = JOYSTICK_4WAY ' Up/down/left/right only (no diagonals) uiGamepadDef.joystick.isAnalog = false ' On screen joystick snaps to full direction uiGamepadDef.joystick.deadzone# = 0.5 ' Half of circle is dead zone uiGamepadDef.buttonCount = 0 ' Don't need any buttons
' Game input will be stored here dim gamepad as TGamepadInput
' Main loop while true
' Update the screen. ' Because the input routines use the "immediate mode" GUI, we must use UIBegin() and UIEnd(). ' These routines automatically clear the screen and perform a DrawText() UIBegin()
' Get input. This must be done between UIBegin() and UIEnd(), as it needs to render ' to the screen (on Android anyway) gamepad = GetGamepadInput()
' Draw the X locate x, y: print "X"; UIEnd()
' Update game state. User input is stored in the gamepad variable. xd = gamepad.dir#(0) yd = gamepad.dir#(1) x = x + xd: y = y + yd if x < 0 then x = 0 endif if x > 39 then x = 39 endif if y < 0 then y = 0 endif if y > 29 then y = 29 endif
' Moderate the game speed WaitTimer(50) wend Cheers, -Tom
|
|
|
Post by yeroen1954 on Nov 4, 2018 1:19:57 GMT
Tom thanks for the info. I did not know this at all. It is with me with trial and error. That is why I miss the contribution of others. Where are they?
|
|
|
Post by Bambcjsi on Dec 3, 2021 15:01:46 GMT
<a href="https://hydroaraleneth.com/#">what is hydroxychloroquine prescribed for</a> chloroquine us
|
|
|
Post by TeewSypefcod on Dec 15, 2021 23:10:56 GMT
|
|