syreniac / verdant-octo-spork Goto Github PK
View Code? Open in Web Editor NEWA group project.
A group project.
Now we have a nice unified colour scheme, the red they're using ATM seems out of place.
Recommended to remove the various /bin/ folders from version control (do git ignore and git remove on them) and instead host each binary build as a 'release', as /bin/ is regeneratable so is effectively clutter that we don't need. @Syreniac
Also don't know what the .o files are for; do we need them under version control? @Syreniac
E-mail the Prototype to Ian Hollyer.
The nature of SDL drawing images from the top left corner means that the simple collision detection used in game_objects.c and specifically the checkResourceNodeCollision() function is not reflective of the graphical positions of the ProgrammableWorkers.
Just a reminder for myself
Maybe?
I have a plan as to how to deal with this, but it will take a fair bit of work in refactoring the UI backend,
I don't think it will effect how people use it particularly, it's just about how arguments are passed into the UIAction_() functions
Recommend placing an 'assets' folder inside /prototype/, from which all images and programmableAI texts are taken (à la my CMakelists.txt – a Mac OS X makefile – which points to an 'assets' folder); I think they're currently being taken from codeAColony/src/images, but I'm not sure. How are the prototype makefiles locating the images to output to bin? I see no reference to a /images/ folder in the makefiles. If you'd be happy to merge my branch, you'd get my suggested structure, but you'd need to change your makefiles to point to the assets folder. @Syreniac
Moving various global configuration stuff to a config fille rather than a .h would enable people to adjust certain things without having to recompile
Might involve use of listening for SDL_KEYUP. Not a top priority feature though.
Probably pairing a UI_KeyPressInRect function and a UI_FlagDestroy function so that it's a little less specific to one use.
Just a reminder for myself.
Ian probably wants us to look at putting some test cases into our code so that we can be sure changes we make don't break anything.
Someone can do this pretty quickly, you'll need to add a pointer into the relevant structs in game_objects.h and then change some functions in game_objects.c
It seems that SDL_Delay never releases control if you pass a negative number to it.
Should be replaced with something more general in application
We need to choose a font. Ian said that https://www.google.com/fonts is a good place to look!
Make two buttons for muting sound and music.
And abuse the preprocessor to work better at stuff.
Changing them from pointers to actual structs in the GraphicsData definition in graphics.h would mean we don't need to manually malloc them because they'd be created on the stack.
If people could periodically check that the repository compiles on their machines, that would be great!
Currently the AI does not support programmability. We will fix this soon(™).
I have even explicitly set there rect.w and rect.h values to 20 when they are created (this shouldn't need to be done because they get these values from the image that is loaded). But somewhere they get set to zero. This might be a similar problem to the bee, which kept getting crazy values for height and width because they were getting clipped when they flew off the screen. This was solved by sending a copy of their rect to the rendering function and not their actual rect (so that clipping changes were not permanent). A similar thing might need to be done for flowers.
Develop a simplistic prototype for Ian Hollyer.
Currently, bee and flower graphics have loose pixels around them after adding transparency through the SDL_SetColorKey function. This should not be happening.
If you're dragging the block when you move out of the expanded block it plays in, when you move back inside, the mouse is registered as still held down. This is minutia, but clearly we want it dropped either when
a) you move out of bounds.
or b) when you release the mouse button.
One of these. I'll play with it a bit tonight.
The relevant colours are all in UIAction_Minimap in UI.c
https://www.libsdl.org/projects/SDL_image/
Note: Linux doesn't seem to have an official SDL_image release corresponding to SDL2, but someone may have made one (perhaps SDL2_image-2.0.0.tar.gz on https://www.libsdl.org/projects/SDL_image/ ? or this..? https://www.archlinux.org/packages/extra/i686/sdl2_image/ ) ; we'll have to have a chat about that. All other platforms have an SDL2-compatible SDL_Image, at least.
The updates between SDL_image and SDL2_image are inconsequential to our uses, so as long as it's backwards compatible (it might not be), we could even investigate just using SDL_image for Linux.
We need to either gitignore them or manually clean them out.
Now that we have a render based system rather than a surface/blit system, we can do some extra magic to make various transformations of our images happen.
The most obvious is to change SDL_RenderCopy() to SDL_RenderCopyEx() in the graphics function that draws all our game objects, and giving it an extra argument representing the desired rotation.
I've grabbed a clip art one, but I hate the art style. Does anyone more graphically talented want to make one?
Our code is currently almost completely undocumented. Having people go through and add comments to all the functions and keep a record of exactly what we have would be good.
Reminder to myself to go back and make it less bizarre at some point.
Clicking functionality returns if you link START to IfWorkerIdle, curiously.
Making a basic menu screen is a little tricky, but goes a long way towards making our program seem more polished.
Start by writing a function in init.c (and add the topline to init.h) that will loop and check events until someone presses a key, and returns once they've pressed it. Then add that function call to the main() function in main.c, in between initialise() and gameStart().
In BlockFunction_CheckOutOfBounds, when it checks the positive y collision, it subtracts the height rather than adding.
Currently there is not even any code to try and display a UI. Ideally we will fix this soon(™).
The windows makefile is missing several parts that are required to get it to compile.
E.g. adding -lSDL_image to the LFLAGS.
The latest fix to the out of bounds function hasn't worked. I believe it was in fact correct to use a '-' as opposed to a '+'. The problem I think actually lies in the fact that the value representing the height and width of the programmableWorker actually changes throughout the game. This shouldn't be the case, but it is. I've used printf and every time the programmable worker gets near the borders of the world, his width and height values change weirdly and randomly, then they change back to normal again as he moves away from the border. I'll try to find out why this is and fix the issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.