Blog

AGK 2 - Animation example

By   2017-02-26

// Project: superfrogger
// Created: 2017-02-20
SetErrorMode(2)
// set window properties
SetWindowTitle( "superfrogger" )
SetWindowSize( 410, 720, 0 )
// set display properties
SetVirtualResolution( 410, 720 )
SetOrientationAllowed( 1, 1, 1, 1 )
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts

CreateSprite ( LoadImage ( "street.jpg" ) )

// create a sprite with ID that has no image
CreateSprite ( 1, 0 )
// add individual images into an animation list
AddSpriteAnimationFrame ( 1, LoadImage ( "horse1.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "horse2.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "horse3.png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "horse4.png" ) )

// play the sprite at 10 fps, looping, going from frame 1 to 5
PlaySprite ( 1, 8, 1, 1, 4 )
SetSpritePosition(1,0,250)
SetSpriteFlip(1,180,0)
carspeed = random(1,5)

do
    PinkX# = GetSpriteX (1)
    
    // move sprite pink1
    SetSpritePosition ( 1, GetSpriteX ( 1 ) + carspeed, 250 )
 
    
    if PinkX# > 400
        SetSpritePosition ( 1,-100,250)
        carspeed = random(1,2)
        SetSpriteColor ( 1, random(1,255), random(1,255), random(1,255), 255 )
    endif

    Sync()
loop

 

Code AKG2 Example

By   2017-02-21

image = LoadImage("red.png")
sprite = CreateSprite(image)
SetSpritePosition(sprite,168,10)

SetSpriteColor ( spritecat, random(50,255), random(50,255), random(50,255), 255 )

PinkX# = GetSpriteX (spritepink)

SetSpritePosition ( spritepink, GetSpriteX ( spritepink ) + badspeed, 135 )

    if PinkX# > 420
        SetSpritePosition ( spritepink,-50,150)
        SetSpriteColor ( spritepink, random(1,255), random(1,255), random(1,255), 255 )
        badspeed = Random(1,5)
    endif

 

Sparckman 2017 - new changes

By   2017-02-09

Hey there guys,

New changes to the site for 2017, Sparckman challenge will be replaced by "game of the week", games need to be sumited as HTML5 in a zip file. Fusion tuturials avaiable only by subscription at UDEMY

New year, new software, new oportunities, the channel and the site will promarity focus on development, Unity3D, Unreal Engine 4, App Game Kit and for drag and drop option engine I'm still considering Construct 3.

Most android and iOS games are being created with Unity 3D, Unreal Engine, GameMaker Studio, Android Studio and Cocos2D. For me it doesn't matter which engine if I have an idea for a game it will happen reguarless of the engine.

EXE Games will be replaced by Html5 games. Thank you all for participating!





 

 

 

Loading...