Code a game competition Nov-Jan 2018 - Minimum £500 prize fund

Started by Qube, November 15, 2017, 04:44:30

Previous topic - Next topic

iWasAdam

@therevills

Here's a base monkey2 320x200 with full window sizing support.
NOTE: Use drawimage, but watch you deport use scaling. use images at 1:1 so pixel perfect. lines will be draw at the window position, but SCREEN resolution!!!


Namespace myLetterboxApp

#Import "<std>"
#Import "<mojo>"
Using std..
Using mojo..

Const Size := New Vec2i( 320, 200 )


Function Main()
New AppInstance

New MyWindow

App.Run()
End


Class MyWindow Extends Window

Method New()
Super.New( "My Window", Size.X, Size.Y, WindowFlags.Resizable )

'if you want a constant canvas size use this
Layout = "letterbox"
'or If you want the canvas to always fill the window use this
' Layout = "fill"

ClearColor = Color.Black
End

Method OnRender( canvas:Canvas ) Override
App.RequestRender()

'fill the screen canvas with a color
canvas.Color = Color.Blue
canvas.DrawRect( 0, 0, Width, Height )

'draw some text at the center of the window
canvas.Color = Color.White
canvas.DrawText( "Hello World", 0, 0 )
End


Method OnMeasure:Vec2i() Override
Return Size
End

End

therevills

Quote from: iWasAdam on November 27, 2017, 06:29:57
Here's a base monkey2 320x200 with full window sizing support.

Very similar to what I was doing, but I had my resolution at 1280x800:


Class MyWindow Extends Window
Field _virtualResolution := New Vec2i(320, 200)

Method New()
Super.New("title", 1280, 800, WindowFlags.Resizable)
Layout = "letterbox"
End

Method OnMeasure:Vec2i() Override
Return _virtualResolution
End


I have found out that Monkey2 has another letterbox layout called "letterbox-int".
| "letterbox-int" | View is uniformly stretched on both axii and centered within its layout frame. Scale factors are integrized.

This is my current way:


Namespace myapp

#Import "<std>"
#Import "<mojo>"

Using std..
Using mojo..

Const VIRTUAL_RES := New Vec2i(320, 200)

Class MyWindow Extends Window
Field gameImage:Image
Field gameCanvas:Canvas

Method New()
Super.New("My Window", 1280, 800, WindowFlags.Resizable)
Layout = "letterbox-int"
' create game image based off the virtual resolution and have it as dynamic
gameImage = New Image(VIRTUAL_RES.x, VIRTUAL_RES.y, PixelFormat.RGBA8, TextureFlags.Dynamic)
' create canvas for the game image
gameCanvas = New Canvas(gameImage)
End

Method OnRender(canvas:Canvas) Override
App.RequestRender()
' turn off filtering
gameCanvas.TextureFilteringEnabled = False
' perform all game rendering to the game canvas
gameCanvas.Clear(Color.Black)
gameCanvas.DrawText("Hello World", Width / 2, Height / 2, .5, .5)
gameCanvas.Flush()
' render the game image to the actual screen
canvas.DrawImage(gameImage, 0, 0)
End

Method OnMeasure:Vec2i() Override
Return VIRTUAL_RES
End
End

Function Main()
New AppInstance
New MyWindow
App.Run()
End

iWasAdam

oooh Letterbox-int that's a good one ;)
I'm having a bit o that!


Steve Elliott

Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

muruba

Sorry, I am wondering if it is 16 colors per whole game or per screen?



IanMartin

Quote
Or you could just double the 160x96 up
I would do that, it would be 320x200, only the 'dots' would be 4 pixels each :P

Quote
have a 4 pixel border top and bottom
I remember the Atari usually had another color around the border of the screen that went all the way to the edges of the CRT...so that's a way for me to fill the screen to the edge so it goes to 200 :)

Now I just have to figure out what to make, heheheh
Platfinity (made with BlitzMax) on Steam:
http://store.steampowered.com/app/365440/Platfinity/

iWasAdam

So Today's pic is something completely different:


This is part of my new chipsynth: It's the tracker!
You get 32 'sounds' to play with and 8 'tracks'. With full control over what note, portamento (slide), pan and volume.

8 tracks makes a pattern. and a sequence is series of patterns. But... Each pattern in a sequence can have individual tracks muted and different volumes set.

So in the above pic you can see just 2 patterns (1 and 2) are being used, but individual tracks are being muted as they are being played, so you get a very varied 'song' with very little effort - well you do have to have a feel for how it will sound in the first place. But it is now operational and loads and saves!!!! YAY!


Derron

Quote from: muruba on November 27, 2017, 11:20:05
Sorry, I am wondering if it is 16 colors per whole game or per screen?




I asked that already... and it seems to be a "global palette" (16 colors per game, not screen). Else it would become very easy to have "themes" (or something like "snow, summer, autumn, spring".




@ Adam
Please stop reminding me that sound/music is not just on my "todo" list but also on my "to learn" list ;-)




bye
Ron


Qube

@therevills - low res vid looks good ;D damn it :P
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Qube

Quote from: iWasAdam on November 27, 2017, 14:54:25
This is part of my new chipsynth: It's the tracker!
You get 32 'sounds' to play with and 8 'tracks'. With full control over what note, portamento (slide), pan and volume.

8 tracks makes a pattern. and a sequence is series of patterns. But... Each pattern in a sequence can have individual tracks muted and different volumes set.

So in the above pic you can see just 2 patterns (1 and 2) are being used, but individual tracks are being muted as they are being played, so you get a very varied 'song' with very little effort - well you do have to have a feel for how it will sound in the first place. But it is now operational and loads and saves!!!! YAY!
Looks interesting  8)  - Any demo's?
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Rooster

Quote from: Derron on November 27, 2017, 15:19:19
@ Adam
Please stop reminding me that sound/music is not just on my "todo" list but also on my "to learn" list ;-)
Based on your last game, I think you will be fine. ;)

iWasAdam

Continuing in the sound process.
Here's a pic of the chipsynth:


You get 50 (not 32) available sounds to create in a bank (on the left), these are coloured and show a mini view of base oscillator.
So... How is a sound created?
You start with the oscillator and a base waveform. the size is the base octave. With the offset/value allowing for PWM modification and finally smooth and roughness to add more 'flavour'. You can also load samples in here instead - but it's not working right now.


The next would be the ADSR envelope section on the right. this is exactly as you would have thought and controls the basic volume parameters.
Pitch Pan and Volume are all using a new concept - that of direct manipulation by drawing. sp for pitch you could draw a wobbly line and get vibrato. the time and scale allowing you control over how much is applied. a little gives vibrato, a lot would give you a real wawa siren, etc.


The last section is the chipFX. These affect the pitch and give controls over the sort of things that the sid chip, and atari arcade machines did, so start with a rough sound, and add a down pitch - instant laser sound. or wobble down and get pacman death sound. it's all very much a visual playground. just fiddle till you get something that sounds great.

But don't forget you have a whole piano range. so the same sound played high will be completely different from one played low. And as this is synthesised, the timing won't change!

Derron

Quote from: Rooster on November 28, 2017, 05:04:12
Based on your last game, I think you will be fine. ;)

This music was from playonloop.com (as credited in the sources.txt). I only put them in "the mix" and edited some of the SFX so they fit to the game.

Music is always a minefield full of copyright infringements. 3-4 chords and you can claim rights on them. So if you once listened to some music in your childhood and create a song with a bit of theses tunes (without "knowing" it) you are already in "jail" with one leg.
Art (pictures and the likes) are copyable, so you can recreate a given picture without trouble (except if you 1:1 clone it and tell others it was the original one). Think it lies in the fact that a "tune" can get recreated based on defined rules (like a mathematical formula). For pictures you can only describe the "sound" but no exact formula (ignoring "perfect face shape"-algorithms for now).

So: music is something I always liked to do but always avoided to do ;-)


@ Adam
Technically impressive - but more important: come up with a good tune. This is what I cannot await to listen to.


bye
Ron