Question about Arcade Vector Graphics

Hello,

I’m SimonMoon. I recently bought Codea and have just started digging in, going thru tutorials, reading discussions, and reading code. This looks like a wonderful app. I have a question or two about creating Arcade style vector graphics in Codea. As examples, BattleZone, Asteroids, Gravitar, Tempest, etc. A game on the AppStore that is like this is Beam Rider Retro, although it appears they use Unity 3d. Looking thru some games here, the closest I’ve seen to this style is Spacewar by MrScience101, and I noticed in the code that he used sprites. The ships were not drawn in Codea. And the Codea example Bit Invader, in which the ship was drawn, but still does not quite have that retro arcade vector look. So, my question is, can I get that retro vector graphics look in Codea by coding, or do I need to make and import sprites for each object?

Thank you for any help or guidance.

Both…kind of…let me explain…

Example to work with…bit invader from the tutorial programs…you can draw your polygons in codea…you can draw circles, dots, lines, whatever you need on that end…sprites are a cosmetic…say you need a background that you don’t want to Paul Signac the entire thing…just import a backdrop from your documents/Dropbox.

Same goes for an image to put over your shape…just import a sprite and use a mesh and you’ll be golden.

As for what can you do in codea…like 99% of all the ideas in the universe: if you can think it, imagine it, dream it, some how, some way, you can code it. And that’s the beauty of computer programming: The sky is the limit.

Lemme try to recreate a retro game…that’s what I’ll do tonight and see how I fare

Edit: drinking + coding does NOT make me mark zuckerberg (for those of you that have seen social network)…I’ll fin this in the morning or sometime tomorrow. Time is 1 am an I’m out. Peace.

Thanks for your help. I’m looking forward to seeing what you come up with. I know it isn’t much, pathetic really as I’m just starting out, but I have been playing with setting up parameter colors and pixel size. Here’s my first attempt with Lua and Codea, a couple of lines and a box with text, just to show I am interesting in learning and not here to just have things handed to me.


-- Main Setup

supportedOrientations(LANDSCAPE_ANY)
displayMode(FULLSCREEN)

-- Use this function to perform your initial setup

function setup()
    -- Define Color Palette
    parameter.color("b", 0, 0, 255, 255)       --blue
    parameter.color("g", 0, 255, 0, 255)       --green
    parameter.color("r", 255, 0, 0, 255)       --red
    parameter.color("y", 255, 255, 0, 255)     --yellow
    parameter.color("o", 255, 110, 0, 255)     --orange
    parameter.color("p", 255, 0, 255, 255)     --purple
    parameter.color("v", 127, 127, 127, 255)   --gray
    parameter.color("l", 255, 255, 255, 255)   --white
    parameter.color("B", 0, 0, 0, 255)         --black
    
    -- Width and Height
    w = WIDTH / 2
    h = HEIGHT / 2
    
end

-- This function gets called once every frame

function draw()
    
    -- Black Background
    background(B)

    -- Red Line
    stroke(r)
    strokeWidth(1)
    line(70, 70, 700, 700)
    noSmooth()
    
    -- Blue Line
    stroke(b)
    strokeWidth(1)
    line(300, 525, 222, 222)

    -- Green Rectangle
    stroke(g)
    strokeWidth(1)
    fill(0, 0, 0, 0)
    rectMode(RADIUS)
    rect(w, h, 40, 40)
    
    -- Purple Text
    font("Futura-CondensedMedium")
    fontSize(20)
    fill(p)
    text("It Works", w, h)
    
end

@SimonMoon - don’t apologise, we all start out as beginners.

It’s fine to ask questions. :slight_smile:

My only suggestion is to keep all your questions about a particular project in the same thread, to keep things tidy (you can always change the title by editing your original post at top).

https://gist.github.com/anonymous/e4941e6c62af0aef2b1a

Avoid the spawning astroids.
Tap and hold on the right side of the screen to navigate.
Tap the left side to drop bombs…

Bombs explode on contact with the astroid and take it down with the bomb.

Your Bombag only holds 30 bombs. When a bomb is blown up, it returns to the bag. Ie: you can only have 30 bombs on the screen or in the bag at once.

Touching an astroid with your player => GAMEOVER

Good luck…my high score is 43…

Hey, that’s cool. Thanks for taking time out to do that. Played a bit. I’ve been going thru the code to see what’s different than the examples I cited. A Polygon physics body, drawn with vec2. To me, that’s what makes the difference, visually. Correct? I’m going to go thru it more when I finish work tonight. I’m sure a couple of questions will pop up. Thanks again. Ah, my high score got to 35 before I had a crash.

The physics engine is simply handles collisions, velocity, and is a nice library for predefined functions and values (x,y,restitution,gravityScale). Nothing else. The drawing is just lines connecting 2 points. Nothing else there.

I was a little drunk when I was writing this and the formatting suffers to that fact. Lemme know if you need help understanding anything.