Editorial


Hello again, and welcome once more to the monthly store missive.

My month has been busy with family live, store work, other work and pushing forward with a couple of personal projects, which all seems to have swallowed most of my time, which is a good job, as here in the Alps it's been raining a lot. I'm actually a big fan of the rain as it forces me to stay in the house and actually get on with things. This kind of forced focus is often something I need, as, like most people in the development world, staying on track and actually finishing a project can be a challenge.  I'll be showcasing one of my up and coming games a little later.

Anyway, back on track, and let's talk about the rest of our community and the store.

We've seen some amazing new media being added to the store, covering a lot of game genres. We've also seen some excellent new support for GameGuru's Easy Building Editor (EBE), with a lot of new textures being uploaded as well as some complete buildings which can be opened in the EBE and edited, and we'll be taking a little look as some of these later.

Okay, now that I've rambled on about not a lot, let's delve deeper into the world of the GCS.

Dave Hawkins,
Editor.

Feature

This month, we're shining our first spotlight on the prolific Fluffy Knuckleduster productions.

Wizzed Off



The mad wizard is at it again, sending all manner of fearsome, ugly and flatulent beasts down his tower to terrorise the villagers! Command Sir Steven, riding his valiant goose steed, James, and defeat as many of the evil creatures as you can!

Collect gold! Find zany powerups! Vie to become the most noble, battle-hardened, fart-blocking knight ever to set foot upon a goose!


Android


iOS


God of Thunder


The Frost Giants have come! Command the hammer Mjolnir as the thunder god, Thor!

Forged in the forges of Svartalfheim by brothers Brokkr and Sindri, the great
hammer Mjolnir is the most powerful of the weapons of the Norse Gods.

Take command of Mjolnir as the mighty Thor, the god of thunder, and drive back the onslaught of the Frost Giants!

[url=https://play.google.com/store/apps/details?id=com.fluffyknuckleduster.godofthunder]Android


[/url]iOS

Fluffy Knuckleduster also market a limited amount of merchandise to support their games, so don't forget to check out their site.

Store News
For those of you who pay attention, you'll know that we here at the store strongly support GameGuru and so were very excited to hear the news that the engine is being finally updated to support Directx11, which will according to rumour, will allow full FBX support as well as opening up the way for some amazing new effects which should see this engine move into the big leagues.. We think you'll join us in welcoming this long overdue update and can assure you all that the store is already working on ensuring that we can accept this new media format for GameGuru.

As well as these minor changes to the store backend, we're still working hard on bringing you a lot of awesome media from our talented artists.

Media News

Let's take a look at some of the excellent new media uploaded to the store in the last month. It's been a really busy month for us, with the return of some old faces, and some new artists joining us.



Some great models from established artist Sula.  A very large number of middle eastern or desert fantasy themed buildings, with a range of props and foliage. These would be great for a wide range of games and are available now.

Take a look at all of Sula's work here.

Application News

Normalizer from store artist provides budding 3D texture artist with all the tools needed to convert image files for normal maps, illumination maps, and many others.In addition to these great export functions, you can apply a number of tweaks and effects to your images.

Check out the video below.



Script news

Looking to create something a little different in GameGuru. Check out this amazingly versatile script from Moshroom that turns GameGuru into a classic, turn-based RPG game.



Read more about this excellent script here

Sign up as a store artist



.The store is growing daily, with over 35,000 registered store users. Artists, both old and new are uploading fresh art, games, apps and 3D media daily. We are always looking for more talented designers, game makers and artists to join our community.  Here at the store, we know just how talented our community is, and we're always looking for new content to expand our range. So if you're a game or app developer, a 2D or 3D artist, a coder, or a sound or music developer, we're interested in seeing what you've got. Don't forget, we will accept content developed for any engine and in virtually any format, so if we don't support your favourite engine, let us know and we'll make that format available.

Our users are always looking for new content, for any engine, so if you've got some great work, why not sign up as a store artist now. It's free, and don't forget, that you'll be making money on every sale.


https://www.tgcstore.net/seller/signup

Bees Knees

Bees Knees is another retro-themed and inspired game from JimJams games. This time they've embraced their love of cartoon as well as classic gameplay with Bees Knees. Created using AppGameKit, this game is due to arrive shortly on the store, JimJamsGames is also seeking a Steam Greenlight while available, so please help support them, and the AppGameKit community by up voting for Bees Knees now.



Click here to vote for Bees Knees.

Invaders Tutorial - Part 3



Welcome to part 3 of our AppGameKit coding tutorial.

First of, if you've only just started following our words of wisdom, let's recap the code so far.

// Project: galaxy
// Created: 2017-03-08

// show all errors
SetErrorMode(2)

// set window properties
SetWindowTitle( "galaxy" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window

// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

//we'll set up a TYPE for the 'invaders'
// x and y are the aliens position and are both floats (allowing decimals)
// active holds a flag to say if the alien is active (still alive)
// sprite will hold the sprite number
type aliens
x as float
y as float
active as integer
sprite as integer
speed as integer
endtype

//Create a new custom type for our invader fire.
type alienfire
x as float
y as float
active as integer
sprite as integer
speed as float
endtype

//Make an array, we will allow 60, one shot for each invader.
dim afire[60] as alienfire

//we will use a single variable to indicate the direction the invader 'mob' moves.
//If a single invader reaches the edge all invaders will change direction.
global aliendirection=1

//load the alien image into image 1 (This image should have been placed in your media folder
loadimage(1,"alien.png")

//Let's load an image for the alien fire.

loadimage(3,"alienfire.png")


//set up an array for the aliens called invaders
//we are allowing 60 which is 12x5
//arrays are always global and can be referenced from any function
dim invaders[60] as aliens

//let's make some aliens.
//first we'll set up some tempoary varible to hold the invaders position on screen and a value for the start of the sprites we'll use.

x=32
y=64
tsprite=100

//run though all 60 invaders and give them a screen position and a sprite
for setupinvaders=1 to 60

//we'll assign some values to some varibles, defining position, activity, speed and the all important sprite number
invaders[setupinvaders].x=x
invaders[setupinvaders].y=y
invaders[setupinvaders].active=1
invaders[setupinvaders].speed=2
invaders[setupinvaders].sprite=tsprite
//create the sprite
createsprite(tsprite,1)
//the sample sprite is animation, so let's set that up
SetSpriteAnimation(tsprite,64,64,4)
//now the sprite has some animation data, we can simply play it.
PlaySprite(tsprite)
//Ok, no real need to set the sprite po
SetSpritePosition(tsprite,invaders[setupinvaders].x,invaders[setupinvaders].y)

inc tsprite,1

inc x,64

if x>786
  x=32
  inc y,64
endif

next setupinvaders
// play is a new type which will hold the player information. As above x and y are the players postion and sprite will hold the sprite number.
type play
x as float
y as float
sprite as integer
endtype

//we'll now set up a global and link it to the play type. Note that this is a global, so that it can be referenced by every part of the code.
global player as play
//now let's define some start values.

player.x=512
player.y=700

//and we'll use sprite 2 and image 2 for the player ship.

player.sprite=2

loadimage(player.sprite,"playership.png")
createsprite(player.sprite,player.sprite)
SetSpritePosition(player.sprite,player.x,player.y)

//currenttime will hold the time in milliseconds for the current frame. Calling GetMilliSeconds() is processor intensive and this will aid performance
//by only calling the function once is a frame

//Create alien fire.
//We'll use sprites 200 - 260

tsprite=199
For makelaser=1 to 60
afire[makelaser].sprite=tsprite
  CreateSprite(tsprite,3)
  //Let's set this sprite off screen
  SetSpritePosition(tsprite,-1000,-1000)
inc tsprite,1
Next makelaser

global currenttime as integer
global frameadjust as float

do

//find out how fast we should move to ensure that 60fps is replicated.
frameadjust = 60*GetFrameTime()
//store current milliseconds for performance.
currenttime=GetMilliseconds()
//move those invaders!
moveinvaders()
//draw them again
drawinvaders()
//let's move the player around a bit
controlplayer()
//and draw the players ship again.
drawplayer()
//Let's control any alien fire
movelaser()

Sync()
loop

//this function will move the invaders and control movement up and down the screen.

function moveinvaders()

//let's set up a couple of variables to decide when to change the movement direction
changedirection=0
movedown=0

//we'll run through the invaders one at a time

for moveinvaders=1 to 60
  //but only if they are active, at first they all will be but if they are destroyed they'll become inactive.
  if invaders[moveinvaders].active=1

//move the invaders in the movement direction, at the correct speed adjusted for slower systems.
inc invaders[moveinvaders].x,aliendirection*(invaders[moveinvaders].speed*frameadjust)

//if any invader is at the right of the screen reverse direction for them all
if invaders[moveinvaders].x>960
changedirection=-1
endif

//if any invader is at the left of the screen reverse direction for them all
if invaders[moveinvaders].x<1
movedown=1
changedirection=1
endif

//There is a chance the invader will fire. Let's say every 1000 frame on average.
randomchance=Random(1,1000)
If randomchance<2
makelaser(moveinvaders)
EndIf

  endif

//move onto the next invader
next moveinvaders

//are the invaders changing direction, if they are reset the movement direction variable
if changedirection<>0
  aliendirection=changedirection
endif

//if they are at the far left of the screen they will also move down
if movedown<>0
  for down=1 to 60
if invaders[down].active=1
inc invaders[down].y,12
endif
  next down
endif

endfunction

//a very simple routine which just update the invaders position, we are using a seperate function for ease of use
//and to aid the addition of features in the future.

function drawinvaders()
//loop through them all
for draw=1 to 60
  //only bother drawing them if they are active to save performance
  if invaders[draw].active=1
SetSpritePosition(invaders[draw].sprite,invaders[draw].x,invaders[draw].y)
  endif
  //move on to the next
next draw

endfunction

//ok, this is where we scan for input to see if the player is trying something exciting.

function controlplayer()

//this is where all player actions take place, as this is an invaders type game, that will be
//moving left and right and later on, firing.
//let's read the keyboard, for this demo, we'll use the arrows to move

//You can find all of the codes for the keys here: https://www.appgamekit.com/documentation/guides/scancodes.htm

//The scancode for left is 37, so let's see if left is pressed

if GetRawKeyState(37)
  //if left is pressed we adjust the player.x value by a negative amount,remembering to adjust for frame rate
  player.x=player.x-4*frameadjust
endif

//The scancode for left is 39, so let's see if right is pressed
if GetRawKeyState(39)
  //if right is pressed we adjust the player.x value by a positive amount,remembering to adjust for frame rate
  player.x=player.x+4*frameadjust
endif

endfunction

function drawplayer()

//make sure the player can't leave the screen

//first left hand side,
if player.x<1 then player.x=1
//then right hand side
if player.x>960 then player.x=960

//ok, job done, let's update the sprite position
SetSpritePosition(player.sprite,player.x,player.y)

endfunction

//Now let's add a couple of functions to create our alien bullets
//and control them.

Function makelaser(invader)

usethisone=0

For find=1 to 60
  If afire[find].active=0
usethisone=find
find=61
  Endif
Next Find

If usethisone<>0
  //We set the alien fire start position based on the invader position.
  afire[usethisone].x=invaders[invader].x+16
  afire[usethisone].y=invaders[invader].y+16
  //make it active
  afire[usethisone].active=1
  //and we'll give it a random speed
  afire[usethisone].speed=random(2,4)
EndIf


EndFunction

Function movelaser()

For movelaser=1 to 60
  If afire[movelaser].active=1
inc afire[movelaser].y,2*afire[movelaser].speed
SetSpritePosition(afire[movelaser].sprite,afire[movelaser].x,afire[movelaser].y)

//If the alien fire is off screen, make it inactive
//and available to be used again.
If afire[movelaser].y>780
afire[movelaser].active=0
EndIf

//Has the player been hit.
If GetSpriteCollision(player.sprite,afire[movelaser].sprite)
player.x=512
player.y=700
EndIf

  EndIf
Next movelaser

EndFunction



If you've not already done so, you'll need to start your own project, refer to our previous newsletters for detail of how to do this if needed.

Just to recap, we left our code with some moving, shooting invaders and a moving player. The invaders could shoot us, but we couldn't defend oursleves. Now as this is hardly fair, let's take a look at evening the odds.

//Add a type for player fire.

type playerfire

x as float
y as float
active as integer
sprite as integer

endtype

//setup an array, we'll allow 6 shots only

dim pfire[6] as playerfire

//we'll set up a variable to time the firerate.
global
playerlastfire

Add this code at the beginning of your code, just after the alienfire TYPE declaration.

Now we'll set up some sprites for our player, so they have something to fire back. We're going to share the alienfire image, so add these lines after we've loaded the image for that.

//We'll set up the player fire sprite here as we'll be using the alien fire image.

for f=1 to 6
pfire[f].sprite=299+f
createsprite(pfire[f].sprite,3)
SetSpritePosition(pfire[f].sprite,-1000,-1000)
next f


Next, let's add a line or two to control the player fire, we'll add this to the function controlplayer()

//Let's shoot some bullets but only every half a second
If GetRawKeyState(32) and currenttime-playerlastfire>500
  makeplayerfire()
endif

   
We'll also need to add a couple of new functions at the end of our code, one to create our bullets and one to move them and check for contact with the invaders.


Function makeplayerfire()

//find a free bullet

usethisone=0

for f=1 to 6
  if pfire[f].active=0
usethisone=f
f=7
  endif
next f

If usethisone<>0
  pfire[usethisone].x=player.x+32
  pfire[usethisone].y=player.y
  pfire[usethisone].active=1
  //set the time of the last fire.
  playerlastfire=currenttime
endif

Endfunction

Function moveplayerfire()

For f=1 to 6
  if pfire[f].active<>0
//if it's active, move it
pfire[f].y=pfire[f].y-4*frameadjust
//update the screen position
SetSpritePosition(pfire[f].sprite,pfire[f].x,pfire[f].y)
//if it leaves the screen make it available
           
            If pfire[f].y<-32
                pfire[f].active=0
            endif
//Let's see if it has collided with any invaders
for g=1 to 60
if invaders[g].active=1
  if GetSpriteCollision(invaders[g].sprite,pfire[f].sprite)
SetSpritePosition(invaders[g].sprite,-10000,-10000)
SetSpritePosition(pfire[f].sprite,-1000,-1000)
invaders[g].active=0
pfire[f].active=0
  endif
endif
next g
  endif
next f

Endfunction


We'll also need to call the moveplayerfire()  function and we'll do this from the main game loop just before the sync()


  //Let's move our player bullets
moveplayerfire()


Ok, now that's all added let's give it a test. You can control the player with the arrow keys and space to fire.

That's it for this month for our coding tutorial. We'll add the final part next month, where we'll look at explosions, adding a score, player lives and a couple of other bits and pieces.

Like us on Facebook

You can follow us on Facebook and receive news and updates about the store and our community.

[url=https://www.facebook.com/gamecreatorstore/]https://www.facebook.com/gamecreatorstore/


[/url]