Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - MrPlow

Pages: [1] 2 3 ... 17
1
Hi Guys

I am using GETJOYX(0) to get Tilt working on Android - but no JOY so far (sorry for the pun!)

I tried to do a keycode scan on it too but no luck either.

checking for GETJOYX(0)>.5 and  GETJOYX(0)<-.5

2
Announcements / New Space Game
« on: 2020-Feb-13 »
Working on this for Android and PC





https://www.youtube.com/watch?v=TTTEKQBOf0o

4
Space Fractal:

Im diddent split this thread correctly, but its was me that tried to property implements admob to glbasic, so we could use java calls to show the ads. Its turned out its was impossible to call java that ways, but required to been inside the Activity. So im have chosen to remove it again and let the original MrPlow implemented stays as its was 100% legit post about it and possible way.

-------------

Thanks SF

I will try your file!!

Also updated steps above to include dependancy for build.gradle file.

5
Hi All,
For GLB users that are interested in Android Studio development and want controller and in-app Ads.

ANDROID ADMOB with Android Studio

Requires the *New* versions of SDLGlbasic.java and Interstitial.java AStudio files. The new update from SF (Im also might edit this post) works perfectly for instant placement of Interstitial Ads in your Apps. This update is still not pushed to steam.

First at all here is the download file for the fixes and extras for Android Studio:
https://www.dropbox.com/s/v5tr0evzehka1v4/Admob.zip?dl=0

Step 1

AndroidManifest.xml - add meta info

<application
        android:isGame="true"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:allowBackup="true"
        android:banner="@mipmap/banner"
        android:hardwareAccelerated="true">
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3940256099942544~3347511713" />
<!-- replace testid with own id -->

....
  <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
    </application>

</manifest>


Step 2

Open string.xml in the res > values folder
Add the following:

<string name="MobileAds_setAdUnitId">ca-app-pub-3940256099942544/1033173712</string>

Note: When live you can replace testid with your own app advert id provided by Admob console



Step 3
open build.gradle file within the "app" folder in Android Studio
add the bolded item to dependancies, so its look like this (its near the bottom of it and the old one can been replaced):

Code: (glbasic) [Select]
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.gms:play-services-ads:18.3.0'
}

in the soon steam update, then the lines has allready been added for new projects, but admob just commented out.

Step 4

Open Android Studio, right click on SDLGlbasic.java and then let it Open in Explorer from the file you have downloaded from the top of the post.

Those 3 files should been placed and eventuelt replace the Java files in that folder.

Open SDLGlbasic.java in AStudio

 ** New version of SDLGlbasic.java is being pushed to Steam soon, so you can skip this step over **

Step 5

In GLBASIC when invoking the ads there is no need to re-load ads - the admob listener takes care of that.

Code: (glbasic) [Select]
?IFDEF ANDROID
IMPORT "C" const char* android_JAVACALL(const char* string)
?ENDIF

FUNCTION JavaCall$: callStr$
?IFDEF ANDROID
STATIC res$
res$ = android_JAVACALL(callStr$)
RETURN res$
?ENDIF
ENDFUNCTION

The above function let you call Java function from Glbasic.

// Run after a command press or touchscreen to start a gameloop / next level / or jump back to main menu
// This call the ads its self and also load a new one.
// Also if a ads has been failed, no ads will been shown, but will try again next time you using it.

JavaCall$("ads_show")

// This returns the current status of ads, if something is happens, fails or succes.
Statust$=JavaCall$("ads_status")

Good luck!

Thanks to SF for sticking it out and getting it sorted in the end!

------

SPACE FRACTAL: This works DOES work now, and im ends with to use tilt, keys and touch events to pickup the JavaCalls from a Activity.



ADDING GAMECONTROLLER for Android Studio

This section is heavy edited as its now much better implemeted and now can use all the JOY() commands for all officiel Google supported JoyPads, those which navigation on system its self works, as well one another, which is the Ouya Controller. A Microsoft Xbox One controller might still not work as im have not tested it.

Now you can use GETJOYNAME$(ID) to get a kind of joystick, if there is any of them. GETJOYNAME$(0) is allways to been used by like a TV Remote as well for TILT. GETJOYNAME$(1) when connected is used by the first connected gamepad controller.

Howover as Mr Plov as pointed out, you can still use KEY() values as this has not been touched as such (except tilt). Howover KEY() now expand more than 256 values: One for each gamepad connected (GETJOYNAME$(0) uses 0-255 and GETJOYNAME$(1) uses KEY(256) -> KEY(511) and so on. This is required to make possible to do multiply gamepad support.

So you can still uses the old KEY() method, if you dont want to use the JOY() commands, but you should newer uses KEY() directly throught, but do its from a function instead. Something like this:

Code: (glbasic) [Select]
FUNCTION getKeyCode: ScanKey
IF ScanKey<0 OR ScanKey>255 THEN RETURN
?IFDEF ANDROID
LOCAL result=0
FOR i=0 TO 4
IF GETJOYNAME$(i)="" THEN RETURN result
result=result+KEY(i)*256
NEXT
RETURN result
?ELSE
RETURN KEY(ScanKey)
?ENDIF
ENDFUNCTION

This make sure all gamepads is got scanned and returned a value, and then you can use a code like this for a button press:

IF getKeyCode(96)=TRUE THEN A_BUTTON=PRESSED

This can works with any one player games and you add a remapping feature if you want. This would do effects for all joypads of course. So been warned, do NOT use KEY() command directly!

A bit of warning: Im do still need to implemented a disconnect features when a gamepads etc can got removed while ingame.

PS. This part is still only hearvy working and needs feedback in this one. Android is a beast when coming to gamecontrollers.

6
Check it out...

https://play.google.com/store/apps/details?id=com.gazzappergames.asteroids.pewpewshooter


- USB Game Controller (please let me know if this works for you)
- Classic Asteroids Gameplay
- In Game Ads on Pause or Home buttons.

Feedback welcome...Make sure version 1.08 or more

7
Hi

I am using stopsound to help create a audio effect in my app but notice this affects other channels as well as my intended sound.
Any idea of how to improve or guarantee a sound playing?
BTW - only happening so far with the mobile version

8
Announcements / Book
« on: 2019-Nov-08 »
Hi Guys

For any of you that like to read! *prepare for shameless plug*

My book is available on all the best online bookstores :) And is a popular Gift Item in the Game Programming categories...

https://www.amazon.co.uk/Micro-Kids-Adventure-Spectrum-Commodore/dp/0993474462/

Aimed at those who grew up with Micros...





9
Bug Reports / Netwebget$
« on: 2019-Oct-31 »
For those that might experience this issue in v16

I notice strange block chars appearing in my highscore tables at the start and end of a netwebget$.
It must be unicode issue or something...

Below is my fix for the issue..

Code: (glbasic) [Select]
scoretable$=NETWEBGET$("www.domain.com","/scoresxxxxxx.php",80,512,4000)

// cleanup string
LOCAL mstr$
FOR x = 1 TO LEN(scoretable$)
mstr$=MID$(scoretable$,x,1)
  IF ASC(mstr$)<32 OR ASC(mstr$)>96
      IF mstr$="|" THEN newscore$=newscore$+mstr$
  ELSE
      newscore$=newscore$+mstr$
  ENDIF
NEXT




10
Bug Reports / Enable Mouse Pointer
« on: 2019-Aug-13 »
I get this when I compile:

!!! EnableMouseInPointer() not found in user32.dll. If this is >=Win8, you get no mouse messages.

Is there a simple fix for this?

11
GLBasic - en / GLB Editior Styles
« on: 2019-Aug-11 »
Hi

Is there a simple way to copy styles from GLB vX to GLB v16.?


12
GLBasic - en / Android - has anyone tried yet?
« on: 2019-Aug-03 »
Hi

Just wondering if anyone has tried the android studio update to build 32/64 versions of GLB apps for mobile?

Can't seem to find any docs on it - how to start / steps involved / etc.

13
Hi Guys

Looking for one that works without needing seedrnd?

Thks!

14
Bug Reports / GLB v12.308 and v14.01 SEEDRND
« on: 2019-Jul-29 »
I know I am using an older versions of the GLB at the moment - I need to for my android apps (for now)
But my issue is that SEEDRND seems to be broken on it.

Is that the case or is there a workaround for it?

both version generate completely differently results for a seed.
Is it possible I am placing it in the wrong position in the code - does that factor into it?


15
Off Topic / Goodreads reviews
« on: 2019-Jul-28 »
Hi Guys,

For anyone that ready any of my books, I am looking for reviews on goodreads - they don't require anything other than reviewers are goodreads members. If you add to the shelf-tag of "Video Games" - that would be a bonus.

https://www.goodreads.com/book/show/43468726-the-micro-kids?ac=1&from_search=true
https://www.goodreads.com/book/show/28242414-zx-spectrum-games-code-club?ac=1&from_search=true

:)

Pages: [1] 2 3 ... 17